Skip to content

Commit

Permalink
Fixec copywrite and *.md File source
Browse files Browse the repository at this point in the history
- Updated move files to avoid *.md files regeneration
- Updated some *.md files to replicate the latest version of the sources
  • Loading branch information
Aregnaz Harutyunyan committed Dec 9, 2024
1 parent 5ce7f6c commit b1b9043
Show file tree
Hide file tree
Showing 32 changed files with 1,121 additions and 484 deletions.
3 changes: 1 addition & 2 deletions api/types/src/convert.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// Copyright (c) 2024 Supra.
// Copyright © Aptos Foundation
// Parts of the project are originally copyright © Meta Platforms, Inc.
// SPDX-License-Identifier: Apache-2.0
//
// Copyright (c) 2024 Supra.

use crate::{
transaction::{
Expand Down
3 changes: 1 addition & 2 deletions api/types/src/transaction.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// Copyright (c) 2024 Supra.
// Copyright © Aptos Foundation
// Parts of the project are originally copyright © Meta Platforms, Inc.
// SPDX-License-Identifier: Apache-2.0
//
// Copyright (c) 2024 Supra.

use crate::{
Address, AptosError, EntryFunctionId, EventGuid, HashValue, HexEncodedBytes,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) 2024 Supra.
// Copyright © Aptos Foundation
// SPDX-License-Identifier: Apache-2.0
//
// Copyright (c) 2024 Supra.

//! This module defines the gas parameters for Aptos Framework & Stdlib.
Expand Down
3 changes: 1 addition & 2 deletions aptos-move/aptos-vm/src/aptos_vm.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// Copyright (c) 2024 Supra.
// Copyright © Aptos Foundation
// Parts of the project are originally copyright © Meta Platforms, Inc.
// SPDX-License-Identifier: Apache-2.0
//
// Copyright (c) 2024 Supra.

use crate::{
block_executor::{AptosTransactionOutput, BlockAptosVM},
Expand Down
3 changes: 1 addition & 2 deletions aptos-move/aptos-vm/src/transaction_metadata.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// Copyright (c) 2024 Supra.
// Copyright © Aptos Foundation
// Parts of the project are originally copyright © Meta Platforms, Inc.
// SPDX-License-Identifier: Apache-2.0
//
// Copyright (c) 2024 Supra.

use aptos_crypto::HashValue;
use aptos_gas_algebra::{FeePerGasUnit, Gas, NumBytes};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ module aptos_std::bls12381 {
//

/// Random signature generated by running `cargo test -- bls12381_sample_signature --nocapture --include-ignored` in `crates/aptos-crypto`.
/// The message signed is "Hello Aptos!" and the associated SK is 07416693b6b32c84abe45578728e2379f525729e5b94762435a31e65ecc728da.
/// The message signed is "Hello Supra!" and the associated SK is 07416693b6b32c84abe45578728e2379f525729e5b94762435a31e65ecc728da.
const RANDOM_SIGNATURE: vector<u8> = x"a01a65854f987d3434149b7f08f70730e30b241984e8712bc2aca885d632aafced4c3f661209debb6b1c8601326623cc16ca2f6c9edc53b7b88b7435fb6b05ddece418d2c34dc6aca2f5a11a79e67774582c14084a01dcb7820e4cb4bad0ea8d";

/// Random signature generated by running `cargo test -- bls12381_sample_signature --nocapture --include-ignored` in `crates/aptos-crypto`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module aptos_std::ed25519 {
// Constants
//

/// The identifier of the Ed25519 signature scheme, which is used when deriving Aptos authentication keys by hashing
/// The identifier of the Ed25519 signature scheme, which is used when deriving Supra authentication keys by hashing
/// it together with an Ed25519 public key.
const SIGNATURE_SCHEME_ID: u8 = 0;

Expand Down Expand Up @@ -156,17 +156,17 @@ module aptos_std::ed25519 {
}
}

/// Derives the Aptos-specific authentication key of the given Ed25519 public key.
/// Derives the Supra-specific authentication key of the given Ed25519 public key.
public fun unvalidated_public_key_to_authentication_key(pk: &UnvalidatedPublicKey): vector<u8> {
public_key_bytes_to_authentication_key(pk.bytes)
}

/// Derives the Aptos-specific authentication key of the given Ed25519 public key.
/// Derives the Supra-specific authentication key of the given Ed25519 public key.
public fun validated_public_key_to_authentication_key(pk: &ValidatedPublicKey): vector<u8> {
public_key_bytes_to_authentication_key(pk.bytes)
}

/// Derives the Aptos-specific authentication key of the given Ed25519 public key.
/// Derives the Supra-specific authentication key of the given Ed25519 public key.
fun public_key_bytes_to_authentication_key(pk_bytes: vector<u8>): vector<u8> {
std::vector::push_back(&mut pk_bytes, SIGNATURE_SCHEME_ID);
std::hash::sha3_256(pk_bytes)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module aptos_std::multi_ed25519 {
// Constants
//

/// The identifier of the MultiEd25519 signature scheme, which is used when deriving Aptos authentication keys by hashing
/// The identifier of the MultiEd25519 signature scheme, which is used when deriving Supra authentication keys by hashing
/// it together with an MultiEd25519 public key.
const SIGNATURE_SCHEME_ID: u8 = 1;

Expand Down Expand Up @@ -232,7 +232,7 @@ module aptos_std::multi_ed25519 {
signature_verify_strict_internal(multisignature.bytes, public_key.bytes, bcs::to_bytes(&encoded))
}

/// Derives the Aptos-specific authentication key of the given Ed25519 public key.
/// Derives the Supra-specific authentication key of the given Ed25519 public key.
public fun unvalidated_public_key_to_authentication_key(pk: &UnvalidatedPublicKey): vector<u8> {
public_key_bytes_to_authentication_key(pk.bytes)
}
Expand All @@ -255,7 +255,7 @@ module aptos_std::multi_ed25519 {
check_and_get_threshold(pk.bytes)
}

/// Derives the Aptos-specific authentication key of the given Ed25519 public key.
/// Derives the Supra-specific authentication key of the given Ed25519 public key.
public fun validated_public_key_to_authentication_key(pk: &ValidatedPublicKey): vector<u8> {
public_key_bytes_to_authentication_key(pk.bytes)
}
Expand Down Expand Up @@ -298,7 +298,7 @@ module aptos_std::multi_ed25519 {
}
}

/// Derives the Aptos-specific authentication key of the given Ed25519 public key.
/// Derives the Supra-specific authentication key of the given Ed25519 public key.
fun public_key_bytes_to_authentication_key(pk_bytes: vector<u8>): vector<u8> {
vector::push_back(&mut pk_bytes, SIGNATURE_SCHEME_ID);
std::hash::sha3_256(pk_bytes)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ module aptos_token_objects::collection {
/// Creates a fixed-sized collection, or a collection that supports a fixed amount of tokens.
/// This is useful to create a guaranteed, limited supply on-chain digital asset. For example,
/// a collection 1111 vicious vipers. Note, creating restrictions such as upward limits results
/// in data structures that prevent Aptos from parallelizing mints of this collection type.
/// in data structures that prevent Supra from parallelizing mints of this collection type.
/// Beyond that, it adds supply tracking with events.
public fun create_fixed_collection(
creator: &signer,
Expand Down Expand Up @@ -239,7 +239,7 @@ module aptos_token_objects::collection {
}

/// Creates an untracked collection, or a collection that supports an arbitrary amount of
/// tokens. This is useful for mass airdrops that fully leverage Aptos parallelization.
/// tokens. This is useful for mass airdrops that fully leverage Supra parallelization.
/// TODO: Hide this until we bring back meaningful way to enforce burns
fun create_untracked_collection(
creator: &signer,
Expand Down
6 changes: 3 additions & 3 deletions aptos-move/framework/aptos-token-objects/sources/token.move
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// This defines an object-based Token. The key differentiating features from the Aptos standard
/// This defines an object-based Token. The key differentiating features from the Supra standard
/// token are:
/// * Decoupled token ownership from token data.
/// * Explicit data model for token metadata via adjacent resources
Expand Down Expand Up @@ -56,7 +56,7 @@ module aptos_token_objects::token {
/// Was populated until concurrent_token_v2_enabled feature flag was enabled.
///
/// The name of the token, which should be unique within the collection; the length of name
/// should be smaller than 128, characters, eg: "Aptos Animal #1234"
/// should be smaller than 128, characters, eg: "Supra Animal #1234"
name: String,
// DEPRECATED
/// The Uniform Resource Identifier (uri) pointing to the JSON file stored in off-chain
Expand All @@ -73,7 +73,7 @@ module aptos_token_objects::token {
/// Unique identifier within the collection, optional, 0 means unassigned
index: AggregatorSnapshot<u64>,
/// The name of the token, which should be unique within the collection; the length of name
/// should be smaller than 128, characters, eg: "Aptos Animal #1234"
/// should be smaller than 128, characters, eg: "Supra Animal #1234"
name: DerivedStringSnapshot,
}

Expand Down
8 changes: 4 additions & 4 deletions aptos-move/framework/aptos-token/sources/token.move
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ module aptos_token::token {
struct TokenDataId has copy, drop, store {
/// The address of the creator, eg: 0xcafe
creator: address,
/// The name of collection; this is unique under the same account, eg: "Aptos Animal Collection"
/// The name of collection; this is unique under the same account, eg: "Supra Animal Collection"
collection: String,
/// The name of the token; this is the same as the name field of TokenData
name: String,
Expand All @@ -195,7 +195,7 @@ module aptos_token::token {
uri: String,
/// The denominator and numerator for calculating the royalty fee; it also contains payee account address for depositing the Royalty
royalty: Royalty,
/// The name of the token, which should be unique within the collection; the length of name should be smaller than 128, characters, eg: "Aptos Animal #1234"
/// The name of the token, which should be unique within the collection; the length of name should be smaller than 128, characters, eg: "Supra Animal #1234"
name: String,
/// Describes this Token
description: String,
Expand Down Expand Up @@ -260,7 +260,7 @@ module aptos_token::token {

/// Represent the collection metadata
struct CollectionData has store {
/// A description for the token collection Eg: "Aptos Toad Overload"
/// A description for the token collection Eg: "Supra Toad Overload"
description: String,
/// The collection name, which should be unique among all collections by the creator; the name should also be smaller than 128 characters, eg: "Animal Collection"
name: String,
Expand All @@ -269,7 +269,7 @@ module aptos_token::token {
/// The number of different TokenData entries in this collection
supply: u64,
/// If maximal is a non-zero value, the number of created TokenData entries should be smaller or equal to this maximum
/// If maximal is 0, Aptos doesn't track the supply of this collection, and there is no limit
/// If maximal is 0, Supra doesn't track the supply of this collection, and there is no limit
maximum: u64,
/// control which collectionData field is mutable
mutability_config: CollectionMutabilityConfig,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// Defines feature flags for Aptos. Those are used in Aptos specific implementations of features in
/// the Move stdlib, the Aptos stdlib, and the Aptos framework.
/// Defines feature flags for Supra. Those are used in Supra specific implementations of features in
/// the Move stdlib, the Supra stdlib, and the Supra framework.
///
/// ============================================================================================
/// Feature Flag Definitions
Expand Down
3 changes: 1 addition & 2 deletions aptos-move/framework/src/natives/transaction_context.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) 2024 Supra.
// Copyright © Aptos Foundation
// SPDX-License-Identifier: Apache-2.0
//
// Copyright (c) 2024 Supra.

use aptos_gas_schedule::gas_params::natives::aptos_framework::*;
use aptos_native_interface::{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ Returns a new aggregator.
<td>2</td>
<td>To create a new aggregator instance, the aggregator factory must already be initialized and exist under the Supra account.</td>
<td>High</td>
<td>The create_aggregator_internal function asserts that AggregatorFactory exists for the Supra account.</td>
<td>The create_aggregator_internal function asserts that AggregatorFactory exists for the Aptos account.</td>
<td>Formally verified via <a href="#high-level-req-2">CreateAggregatorInternalAbortsIf</a>.</td>
</tr>

Expand Down
2 changes: 1 addition & 1 deletion aptos-move/framework/supra-framework/doc/block.md
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ new block event for WriteSetPayload.

<tr>
<td>1</td>
<td>During the module's initialization, it guarantees that the BlockResource resource moves under the Supra framework account with initial values.</td>
<td>During the module's initialization, it guarantees that the BlockResource resource moves under the Aptos framework account with initial values.</td>
<td>High</td>
<td>The initialize function is responsible for setting up the initial state of the module, ensuring that the following conditions are met (1) the BlockResource resource is created, indicating its existence within the module's context, and moved under the Supra framework account, (2) the block height is set to zero during initialization, and (3) the epoch interval is greater than zero.</td>
<td>Formally Verified via <a href="#high-level-req-1">Initialize</a>.</td>
Expand Down
2 changes: 1 addition & 1 deletion aptos-move/framework/supra-framework/doc/chain_id.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Return the chain ID of this instance.

<tr>
<td>2</td>
<td>The chain id can only be fetched if the chain id resource exists under the Supra framework account.</td>
<td>The chain id can only be fetched if the chain id resource exists under the Aptos framework account.</td>
<td>Low</td>
<td>The chain_id::get function fetches the chain id by borrowing the ChainId resource from the supra_framework account.</td>
<td>Formally verified via <a href="#high-level-req-2">get</a>.</td>
Expand Down
35 changes: 23 additions & 12 deletions aptos-move/framework/supra-framework/doc/genesis.md
Original file line number Diff line number Diff line change
Expand Up @@ -797,17 +797,23 @@ If it exists, it just returns the signer.
<summary>Implementation</summary>


<pre><code><b>fun</b> <a href="genesis.md#0x1_genesis_create_multiple_multisig_accounts_with_schema">create_multiple_multisig_accounts_with_schema</a>(supra_framework: &<a href="../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer">signer</a>,
owner: <b>address</b>, additional_owners: <a href="../../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;<b>address</b>&gt;,num_signatures_required:u64,metadata_keys:<a href="../../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;String&gt;,metadata_values:<a href="../../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;<a href="../../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;u8&gt;&gt;,
timeout_duration:u64, balance:u64, num_of_accounts: u32): <a href="../../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;<b>address</b>&gt; {

<pre><code><b>fun</b> <a href="genesis.md#0x1_genesis_create_multiple_multisig_accounts_with_schema">create_multiple_multisig_accounts_with_schema</a>(
supra_framework: &<a href="../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer">signer</a>,
owner: <b>address</b>,
additional_owners: <a href="../../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;<b>address</b>&gt;,
num_signatures_required:u64,
metadata_keys:<a href="../../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;String&gt;,
metadata_values:<a href="../../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;<a href="../../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;u8&gt;&gt;,
timeout_duration:u64,
balance:u64,
num_of_accounts: u32
): <a href="../../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;<b>address</b>&gt; {
<b>let</b> counter = 0;
<b>let</b> result = <a href="../../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector_empty">vector::empty</a>();
<b>while</b> (counter &lt; num_of_accounts) {
<b>let</b> account_addr = <a href="genesis.md#0x1_genesis_create_multisig_account_with_balance">create_multisig_account_with_balance</a>(supra_framework, owner, additional_owners,
num_signatures_required,metadata_keys,metadata_values,timeout_duration,balance);
<a href="../../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector_push_back">vector::push_back</a>(&<b>mut</b> result,account_addr);
<a href="account.md#0x1_account_increment_sequence_number">account::increment_sequence_number</a>(owner);
counter = counter + 1;
};
result
Expand All @@ -833,20 +839,25 @@ timeout_duration:u64, balance:u64, num_of_accounts: u32): <a href="../../aptos-s
<summary>Implementation</summary>


<pre><code><b>fun</b> <a href="genesis.md#0x1_genesis_create_multisig_account_with_balance">create_multisig_account_with_balance</a>(supra_framework: &<a href="../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer">signer</a>, owner: <b>address</b>, additional_owners: <a href="../../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;<b>address</b>&gt;,
num_signatures_required:u64, metadata_keys: <a href="../../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;String&gt;,
metadata_values: <a href="../../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;<a href="../../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;u8&gt;&gt;, timeout_duration: u64, balance:u64 ) : <b>address</b> {


<pre><code><b>fun</b> <a href="genesis.md#0x1_genesis_create_multisig_account_with_balance">create_multisig_account_with_balance</a>(
supra_framework: &<a href="../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer">signer</a>,
owner: <b>address</b>,
additional_owners: <a href="../../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;<b>address</b>&gt;,
num_signatures_required:u64,
metadata_keys: <a href="../../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;String&gt;,
metadata_values: <a href="../../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;<a href="../../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector">vector</a>&lt;u8&gt;&gt;,
timeout_duration: u64,
balance:u64,
): <b>address</b> {
<b>assert</b>!(<a href="account.md#0x1_account_exists_at">account::exists_at</a>(owner),<a href="../../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error_invalid_argument">error::invalid_argument</a>(<a href="genesis.md#0x1_genesis_EACCOUNT_DOES_NOT_EXIST">EACCOUNT_DOES_NOT_EXIST</a>));
<b>assert</b>!(<a href="../../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector_all">vector::all</a>(&additional_owners,|ao_addr|{<a href="account.md#0x1_account_exists_at">account::exists_at</a>(*ao_addr)}),<a href="../../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error_invalid_argument">error::invalid_argument</a>(<a href="genesis.md#0x1_genesis_EACCOUNT_DOES_NOT_EXIST">EACCOUNT_DOES_NOT_EXIST</a>));
<b>let</b> addr = <a href="multisig_account.md#0x1_multisig_account_get_next_multisig_account_address">multisig_account::get_next_multisig_account_address</a>(owner);
<b>let</b> owner_signer = <a href="create_signer.md#0x1_create_signer">create_signer</a>(owner);
<a href="multisig_account.md#0x1_multisig_account_create_with_owners">multisig_account::create_with_owners</a>(&owner_signer,additional_owners,num_signatures_required,metadata_keys,metadata_values,timeout_duration);
<a href="supra_coin.md#0x1_supra_coin_mint">supra_coin::mint</a>(supra_framework,addr,balance);
<a href="account.md#0x1_account_increment_sequence_number">account::increment_sequence_number</a>(owner);
addr

}
}
</code></pre>


Expand Down
Loading

0 comments on commit b1b9043

Please sign in to comment.