Skip to content

Commit

Permalink
[compiler-v2 native] Change framework name
Browse files Browse the repository at this point in the history
  • Loading branch information
welbon committed Sep 27, 2024
1 parent b2f3715 commit c3e87b1
Show file tree
Hide file tree
Showing 163 changed files with 1,073 additions and 1,073 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ pub fn aptos_token_create_collection(
// 0, 0, 0, 4,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4,
]),
ident_str!("aptos_token").to_owned(),
ident_str!("starcoin_token").to_owned(),
),
ident_str!("create_collection").to_owned(),
vec![],
Expand Down Expand Up @@ -240,7 +240,7 @@ pub fn aptos_token_mint(
// 0, 0, 0, 4,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4,
]),
ident_str!("aptos_token").to_owned(),
ident_str!("starcoin_token").to_owned(),
),
ident_str!("mint").to_owned(),
vec![],
Expand Down Expand Up @@ -274,7 +274,7 @@ pub fn aptos_token_mint_soul_bound(
// 0, 0, 0, 4,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4,
]),
ident_str!("aptos_token").to_owned(),
ident_str!("starcoin_token").to_owned(),
),
ident_str!("mint_soul_bound").to_owned(),
vec![],
Expand Down
4 changes: 2 additions & 2 deletions vm/framework/move-stdlib/doc/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ Lifetime: transient

<a id="0x1_features_JWK_CONSENSUS"></a>

Deprecated by <code>aptos_framework::jwk_consensus_config::JWKConsensusConfig</code>.
Deprecated by <code>starcoin_framework::jwk_consensus_config::JWKConsensusConfig</code>.


<pre><code><b>const</b> <a href="features.md#0x1_features_JWK_CONSENSUS">JWK_CONSENSUS</a>: u64 = 49;
Expand Down Expand Up @@ -755,7 +755,7 @@ Lifetime: transient

<a id="0x1_features_RECONFIGURE_WITH_DKG"></a>

Deprecated by <code>aptos_framework::randomness_config::RandomnessConfig</code>.
Deprecated by <code>starcoin_framework::randomness_config::RandomnessConfig</code>.


<pre><code><b>const</b> <a href="features.md#0x1_features_RECONFIGURE_WITH_DKG">RECONFIGURE_WITH_DKG</a>: u64 = 45;
Expand Down
2 changes: 1 addition & 1 deletion vm/framework/move-stdlib/sources/configs/features.move
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ module std::features {
is_enabled(PERIODICAL_REWARD_RATE_DECREASE)
}

/// Whether enable paritial governance voting on aptos_governance.
/// Whether enable paritial governance voting on starcoin_governance.
/// Lifetime: transient
const PARTIAL_GOVERNANCE_VOTING: u64 = 17;

Expand Down
8 changes: 4 additions & 4 deletions vm/framework/starcoin-framework/Move.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[package]
name = "AptosFramework"
name = "StarcoinFramework"
version = "1.0.0"

[addresses]
std = "0x1"
aptos_std = "0x1"
starcoin_std = "0x1"
starcoin_framework = "0x1"
aptos_fungible_asset = "0xA"
aptos_token = "0x3"
starcoin_fungible_asset = "0xA"
starcoin_token = "0x3"
core_resources = "0xA550C18"
vm_reserved = "0x0"

Expand Down
16 changes: 8 additions & 8 deletions vm/framework/starcoin-framework/sources/account.move
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ module starcoin_framework::account {
use starcoin_framework::event::{Self, EventHandle};
use starcoin_framework::guid;
use starcoin_framework::system_addresses;
use aptos_std::ed25519;
use aptos_std::from_bcs;
use aptos_std::multi_ed25519;
use aptos_std::table::{Self, Table};
use aptos_std::type_info::{Self, TypeInfo};
use starcoin_std::ed25519;
use starcoin_std::from_bcs;
use starcoin_std::multi_ed25519;
use starcoin_std::table::{Self, Table};
use starcoin_std::type_info::{Self, TypeInfo};

friend starcoin_framework::aptos_account;
friend starcoin_framework::starcoin_account;
friend starcoin_framework::coin;
friend starcoin_framework::genesis;
friend starcoin_framework::multisig_account;
Expand Down Expand Up @@ -179,7 +179,7 @@ module starcoin_framework::account {

/// Only called during genesis to initialize system resources for this module.
public(friend) fun initialize(starcoin_framework: &signer) {
system_addresses::assert_aptos_framework(starcoin_framework);
system_addresses::assert_starcoin_framework(starcoin_framework);
move_to(starcoin_framework, OriginatingAddress {
address_map: table::new(),
});
Expand All @@ -200,7 +200,7 @@ module starcoin_framework::account {

// NOTE: @core_resources gets created via a `create_account` call, so we do not include it below.
assert!(
new_address != @vm_reserved && new_address != @starcoin_framework && new_address != @aptos_token,
new_address != @vm_reserved && new_address != @starcoin_framework && new_address != @starcoin_token,
error::invalid_argument(ECANNOT_RESERVED_ADDRESS)
);

Expand Down
6 changes: 3 additions & 3 deletions vm/framework/starcoin-framework/sources/account.spec.move
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ spec starcoin_framework::account {
/// OriginatingAddress does not exist under `@starcoin_framework` before the call.
spec initialize(starcoin_framework: &signer) {
let aptos_addr = signer::address_of(starcoin_framework);
aborts_if !system_addresses::is_aptos_framework_address(aptos_addr);
aborts_if !system_addresses::is_starcoin_framework_address(aptos_addr);
aborts_if exists<OriginatingAddress>(aptos_addr);
ensures exists<OriginatingAddress>(aptos_addr);
}
Expand All @@ -125,7 +125,7 @@ spec starcoin_framework::account {
aborts_if !exists<Account>(account_address) && (
account_address == @vm_reserved
|| account_address == @starcoin_framework
|| account_address == @aptos_token
|| account_address == @starcoin_token
|| !(len(authentication_key) == 32)
);
ensures exists<Account>(account_address);
Expand All @@ -137,7 +137,7 @@ spec starcoin_framework::account {
/// Limit the new account address is not @vm_reserved / @starcoin_framework / @aptos_toke.
spec create_account(new_address: address): signer {
include CreateAccountAbortsIf {addr: new_address};
aborts_if new_address == @vm_reserved || new_address == @starcoin_framework || new_address == @aptos_token;
aborts_if new_address == @vm_reserved || new_address == @starcoin_framework || new_address == @starcoin_token;
ensures signer::address_of(result) == new_address;
/// [high-level-req-2]
ensures exists<Account>(new_address);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module starcoin_framework::aggregator_factory {

use starcoin_framework::system_addresses;
use starcoin_framework::aggregator::Aggregator;
use aptos_std::table::{Self, Table};
use starcoin_std::table::{Self, Table};

friend starcoin_framework::genesis;
friend starcoin_framework::optional_aggregator;
Expand All @@ -25,7 +25,7 @@ module starcoin_framework::aggregator_factory {

/// Creates a new factory for aggregators. Can only be called during genesis.
public(friend) fun initialize_aggregator_factory(starcoin_framework: &signer) {
system_addresses::assert_aptos_framework(starcoin_framework);
system_addresses::assert_starcoin_framework(starcoin_framework);
let aggregator_factory = AggregatorFactory {
phantom_table: table::new()
};
Expand All @@ -47,7 +47,7 @@ module starcoin_framework::aggregator_factory {
/// to allow any signer to call.
public fun create_aggregator(account: &signer, limit: u128): Aggregator acquires AggregatorFactory {
// Only Aptos Framework (0x1) account can call this for now.
system_addresses::assert_aptos_framework(account);
system_addresses::assert_starcoin_framework(account);
create_aggregator_internal(limit)
}

Expand Down
6 changes: 3 additions & 3 deletions vm/framework/starcoin-framework/sources/block.move
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module starcoin_framework::block {
use std::features;
use std::vector;
use std::option;
use aptos_std::table_with_length::{Self, TableWithLength};
use starcoin_std::table_with_length::{Self, TableWithLength};
use std::option::Option;
use starcoin_framework::randomness;

Expand Down Expand Up @@ -91,7 +91,7 @@ module starcoin_framework::block {

/// This can only be called during Genesis.
public(friend) fun initialize(starcoin_framework: &signer, epoch_interval_microsecs: u64) {
system_addresses::assert_aptos_framework(starcoin_framework);
system_addresses::assert_starcoin_framework(starcoin_framework);
assert!(epoch_interval_microsecs > 0, error::invalid_argument(EZERO_EPOCH_INTERVAL));

move_to<CommitHistory>(starcoin_framework, CommitHistory {
Expand Down Expand Up @@ -127,7 +127,7 @@ module starcoin_framework::block {
starcoin_framework: &signer,
new_epoch_interval: u64,
) acquires BlockResource {
system_addresses::assert_aptos_framework(starcoin_framework);
system_addresses::assert_starcoin_framework(starcoin_framework);
assert!(new_epoch_interval > 0, error::invalid_argument(EZERO_EPOCH_INTERVAL));

let block_resource = borrow_global_mut<BlockResource>(@starcoin_framework);
Expand Down
4 changes: 2 additions & 2 deletions vm/framework/starcoin-framework/sources/block.spec.move
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ spec starcoin_framework::block {
spec schema BlockRequirement {
use starcoin_framework::chain_status;
use starcoin_framework::coin::CoinInfo;
use starcoin_framework::aptos_coin::AptosCoin;
use starcoin_framework::starcoin_coin::StarcoinCoin;
use starcoin_framework::transaction_fee;
use starcoin_framework::staking_config;

Expand All @@ -146,7 +146,7 @@ spec starcoin_framework::block {
requires (proposer == @vm_reserved) ==> (timestamp::spec_now_microseconds() == timestamp);
requires (proposer != @vm_reserved) ==> (timestamp::spec_now_microseconds() < timestamp);
requires exists<stake::ValidatorFees>(@starcoin_framework);
requires exists<CoinInfo<AptosCoin>>(@starcoin_framework);
requires exists<CoinInfo<StarcoinCoin>>(@starcoin_framework);
include transaction_fee::RequiresCollectedFeesPerValueLeqBlockAptosSupply;
include staking_config::StakingRewardsConfigRequirement;
}
Expand Down
2 changes: 1 addition & 1 deletion vm/framework/starcoin-framework/sources/chain_id.move
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module starcoin_framework::chain_id {
/// Only called during genesis.
/// Publish the chain ID `id` of this instance under the SystemAddresses address
public(friend) fun initialize(starcoin_framework: &signer, id: u8) {
system_addresses::assert_aptos_framework(starcoin_framework);
system_addresses::assert_starcoin_framework(starcoin_framework);
move_to(starcoin_framework, ChainId { id })
}

Expand Down
2 changes: 1 addition & 1 deletion vm/framework/starcoin-framework/sources/chain_status.move
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module starcoin_framework::chain_status {

/// Marks that genesis has finished.
public(friend) fun set_genesis_end(starcoin_framework: &signer) {
system_addresses::assert_aptos_framework(starcoin_framework);
system_addresses::assert_starcoin_framework(starcoin_framework);
move_to(starcoin_framework, GenesisEndMarker {});
}

Expand Down
4 changes: 2 additions & 2 deletions vm/framework/starcoin-framework/sources/code.move
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module starcoin_framework::code {

use starcoin_framework::util;
use starcoin_framework::system_addresses;
use aptos_std::copyable_any::Any;
use starcoin_std::copyable_any::Any;
use std::option::Option;
use std::string;
use starcoin_framework::event;
Expand Down Expand Up @@ -133,7 +133,7 @@ module starcoin_framework::code {
/// Initialize package metadata for Genesis.
fun initialize(starcoin_framework: &signer, package_owner: &signer, metadata: PackageMetadata)
acquires PackageRegistry {
system_addresses::assert_aptos_framework(starcoin_framework);
system_addresses::assert_starcoin_framework(starcoin_framework);
let addr = signer::address_of(package_owner);
if (!exists<PackageRegistry>(addr)) {
move_to(package_owner, PackageRegistry { packages: vector[metadata] })
Expand Down
2 changes: 1 addition & 1 deletion vm/framework/starcoin-framework/sources/code.spec.move
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ spec starcoin_framework::code {
spec initialize(starcoin_framework: &signer, package_owner: &signer, metadata: PackageMetadata) {
let aptos_addr = signer::address_of(starcoin_framework);
let owner_addr = signer::address_of(package_owner);
aborts_if !system_addresses::is_aptos_framework_address(aptos_addr);
aborts_if !system_addresses::is_starcoin_framework_address(aptos_addr);

ensures exists<PackageRegistry>(owner_addr);
}
Expand Down
24 changes: 12 additions & 12 deletions vm/framework/starcoin-framework/sources/coin.move
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module starcoin_framework::coin {
use std::option::{Self, Option};
use std::signer;
use std::string::{Self, String};
use aptos_std::table::{Self, Table};
use starcoin_std::table::{Self, Table};

use starcoin_framework::account;
use starcoin_framework::aggregator_factory;
Expand All @@ -18,10 +18,10 @@ module starcoin_framework::coin {
use starcoin_framework::fungible_asset::{Self, FungibleAsset, Metadata, MintRef, TransferRef, BurnRef};
use starcoin_framework::object::{Self, Object, object_address};
use starcoin_framework::primary_fungible_store;
use aptos_std::type_info::{Self, TypeInfo, type_name};
use starcoin_std::type_info::{Self, TypeInfo, type_name};
use starcoin_framework::create_signer;

friend starcoin_framework::aptos_coin;
friend starcoin_framework::starcoin_coin;
friend starcoin_framework::genesis;
friend starcoin_framework::transaction_fee;

Expand Down Expand Up @@ -286,24 +286,24 @@ module starcoin_framework::coin {
}

public entry fun create_coin_conversion_map(starcoin_framework: &signer) {
system_addresses::assert_aptos_framework(starcoin_framework);
system_addresses::assert_starcoin_framework(starcoin_framework);
if (!exists<CoinConversionMap>(@starcoin_framework)) {
move_to(starcoin_framework, CoinConversionMap {
coin_to_fungible_asset_map: table::new(),
})
};
}

/// Create APT pairing by passing `AptosCoin`.
/// Create APT pairing by passing `StarcoinCoin`.
public entry fun create_pairing<CoinType>(
starcoin_framework: &signer
) acquires CoinConversionMap, CoinInfo {
system_addresses::assert_aptos_framework(starcoin_framework);
system_addresses::assert_starcoin_framework(starcoin_framework);
create_and_return_paired_metadata_if_not_exist<CoinType>(true);
}

inline fun is_apt<CoinType>(): bool {
type_info::type_name<CoinType>() == string::utf8(b"0x1::aptos_coin::AptosCoin")
type_info::type_name<CoinType>() == string::utf8(b"0x1::starcoin_coin::StarcoinCoin")
}

inline fun create_and_return_paired_metadata_if_not_exist<CoinType>(allow_apt_creation: bool): Object<Metadata> {
Expand All @@ -319,10 +319,10 @@ module starcoin_framework::coin {
assert!(!is_apt || allow_apt_creation, error::invalid_state(EAPT_PAIRING_IS_NOT_ENABLED));
let metadata_object_cref =
if (is_apt) {
object::create_sticky_object_at_address(@starcoin_framework, @aptos_fungible_asset)
object::create_sticky_object_at_address(@starcoin_framework, @starcoin_fungible_asset)
} else {
object::create_named_object(
&create_signer::create_signer(@aptos_fungible_asset),
&create_signer::create_signer(@starcoin_fungible_asset),
*string::bytes(&type_info::type_name<CoinType>())
)
};
Expand Down Expand Up @@ -544,14 +544,14 @@ module starcoin_framework::coin {

/// Publishes supply configuration. Initially, upgrading is not allowed.
public(friend) fun initialize_supply_config(starcoin_framework: &signer) {
system_addresses::assert_aptos_framework(starcoin_framework);
system_addresses::assert_starcoin_framework(starcoin_framework);
move_to(starcoin_framework, SupplyConfig { allow_upgrades: false });
}

/// This should be called by on-chain governance to update the config and allow
/// or disallow upgradability of total supply.
public fun allow_supply_upgrades(starcoin_framework: &signer, allowed: bool) acquires SupplyConfig {
system_addresses::assert_aptos_framework(starcoin_framework);
system_addresses::assert_starcoin_framework(starcoin_framework);
let allow_upgrades = &mut borrow_global_mut<SupplyConfig>(@starcoin_framework).allow_upgrades;
*allow_upgrades = allowed;
}
Expand Down Expand Up @@ -1061,7 +1061,7 @@ module starcoin_framework::coin {
decimals: u8,
monitor_supply: bool,
): (BurnCapability<CoinType>, FreezeCapability<CoinType>, MintCapability<CoinType>) {
system_addresses::assert_aptos_framework(account);
system_addresses::assert_starcoin_framework(account);
initialize_internal(account, name, symbol, decimals, monitor_supply, true)
}

Expand Down
4 changes: 2 additions & 2 deletions vm/framework/starcoin-framework/sources/coin.spec.move
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ spec starcoin_framework::coin {
/// Can only be published by reserved addresses.
spec initialize_supply_config(starcoin_framework: &signer) {
let aptos_addr = signer::address_of(starcoin_framework);
aborts_if !system_addresses::is_aptos_framework_address(aptos_addr);
aborts_if !system_addresses::is_starcoin_framework_address(aptos_addr);
aborts_if exists<SupplyConfig>(aptos_addr);
ensures !global<SupplyConfig>(aptos_addr).allow_upgrades;
ensures exists<SupplyConfig>(aptos_addr);
Expand All @@ -133,7 +133,7 @@ spec starcoin_framework::coin {
spec allow_supply_upgrades(starcoin_framework: &signer, allowed: bool) {
modifies global<SupplyConfig>(@starcoin_framework);
let aptos_addr = signer::address_of(starcoin_framework);
aborts_if !system_addresses::is_aptos_framework_address(aptos_addr);
aborts_if !system_addresses::is_starcoin_framework_address(aptos_addr);
aborts_if !exists<SupplyConfig>(aptos_addr);
let post allow_upgrades_post = global<SupplyConfig>(@starcoin_framework);
ensures allow_upgrades_post.allow_upgrades == allowed;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
/// NOTE: on-chain config `0x1::state::ValidatorSet` implemented its own buffer.
module starcoin_framework::config_buffer {
use std::string::String;
use aptos_std::any;
use aptos_std::any::Any;
use aptos_std::simple_map;
use aptos_std::simple_map::SimpleMap;
use aptos_std::type_info;
use starcoin_std::any;
use starcoin_std::any::Any;
use starcoin_std::simple_map;
use starcoin_std::simple_map::SimpleMap;
use starcoin_std::type_info;
use starcoin_framework::system_addresses;

friend starcoin_framework::consensus_config;
Expand All @@ -37,7 +37,7 @@ module starcoin_framework::config_buffer {
}

public fun initialize(starcoin_framework: &signer) {
system_addresses::assert_aptos_framework(starcoin_framework);
system_addresses::assert_starcoin_framework(starcoin_framework);
if (!exists<PendingConfigs>(@starcoin_framework)) {
move_to(starcoin_framework, PendingConfigs {
configs: simple_map::new(),
Expand Down
Loading

0 comments on commit c3e87b1

Please sign in to comment.