Skip to content

Commit 6c5ff55

Browse files
authored
Updated md files and prebuilt packages (#318)
Co-authored-by: Aregnaz Harutyunyan <>
1 parent 0c743c4 commit 6c5ff55

File tree

6 files changed

+171
-62
lines changed

6 files changed

+171
-62
lines changed

aptos-move/framework/cached-packages/src/aptos_framework_sdk_builder.rs

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,11 @@ pub enum EntryFunctionCall {
545545
amount: u64,
546546
},
547547

548+
PboDelegationPoolAdminIncreaseLastUnlockPeriod {
549+
pool_address: AccountAddress,
550+
additional_periods: u64,
551+
},
552+
548553
/// Allows a delegator to delegate its voting power to a voter. If this delegator already has a delegated voter,
549554
/// this change won't take effects until the next lockup period.
550555
PboDelegationPoolDelegateVotingPower {
@@ -1583,6 +1588,13 @@ impl EntryFunctionCall {
15831588
pool_address,
15841589
amount,
15851590
} => pbo_delegation_pool_add_stake(pool_address, amount),
1591+
PboDelegationPoolAdminIncreaseLastUnlockPeriod {
1592+
pool_address,
1593+
additional_periods,
1594+
} => pbo_delegation_pool_admin_increase_last_unlock_period(
1595+
pool_address,
1596+
additional_periods,
1597+
),
15861598
PboDelegationPoolDelegateVotingPower {
15871599
pool_address,
15881600
new_voter,
@@ -3432,6 +3444,27 @@ pub fn pbo_delegation_pool_add_stake(
34323444
))
34333445
}
34343446

3447+
pub fn pbo_delegation_pool_admin_increase_last_unlock_period(
3448+
pool_address: AccountAddress,
3449+
additional_periods: u64,
3450+
) -> TransactionPayload {
3451+
TransactionPayload::EntryFunction(EntryFunction::new(
3452+
ModuleId::new(
3453+
AccountAddress::new([
3454+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3455+
0, 0, 0, 1,
3456+
]),
3457+
ident_str!("pbo_delegation_pool").to_owned(),
3458+
),
3459+
ident_str!("admin_increase_last_unlock_period").to_owned(),
3460+
vec![],
3461+
vec![
3462+
bcs::to_bytes(&pool_address).unwrap(),
3463+
bcs::to_bytes(&additional_periods).unwrap(),
3464+
],
3465+
))
3466+
}
3467+
34353468
/// Allows a delegator to delegate its voting power to a voter. If this delegator already has a delegated voter,
34363469
/// this change won't take effects until the next lockup period.
34373470
pub fn pbo_delegation_pool_delegate_voting_power(
@@ -6321,6 +6354,21 @@ mod decoder {
63216354
}
63226355
}
63236356

6357+
pub fn pbo_delegation_pool_admin_increase_last_unlock_period(
6358+
payload: &TransactionPayload,
6359+
) -> Option<EntryFunctionCall> {
6360+
if let TransactionPayload::EntryFunction(script) = payload {
6361+
Some(
6362+
EntryFunctionCall::PboDelegationPoolAdminIncreaseLastUnlockPeriod {
6363+
pool_address: bcs::from_bytes(script.args().get(0)?).ok()?,
6364+
additional_periods: bcs::from_bytes(script.args().get(1)?).ok()?,
6365+
},
6366+
)
6367+
} else {
6368+
None
6369+
}
6370+
}
6371+
63246372
pub fn pbo_delegation_pool_delegate_voting_power(
63256373
payload: &TransactionPayload,
63266374
) -> Option<EntryFunctionCall> {
@@ -7818,6 +7866,10 @@ static SCRIPT_FUNCTION_DECODER_MAP: once_cell::sync::Lazy<EntryFunctionDecoderMa
78187866
"pbo_delegation_pool_add_stake".to_string(),
78197867
Box::new(decoder::pbo_delegation_pool_add_stake),
78207868
);
7869+
map.insert(
7870+
"pbo_delegation_pool_admin_increase_last_unlock_period".to_string(),
7871+
Box::new(decoder::pbo_delegation_pool_admin_increase_last_unlock_period),
7872+
);
78217873
map.insert(
78227874
"pbo_delegation_pool_delegate_voting_power".to_string(),
78237875
Box::new(decoder::pbo_delegation_pool_delegate_voting_power),

aptos-move/framework/supra-framework/doc/coin.md

Lines changed: 24 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,16 +1034,6 @@ The value of aggregatable coin used for transaction fees redistribution does not
10341034

10351035

10361036

1037-
<a id="0x1_coin_EAPT_PAIRING_IS_NOT_ENABLED"></a>
1038-
1039-
SUPRA pairing is not eanbled yet.
1040-
1041-
1042-
<pre><code><b>const</b> <a href="coin.md#0x1_coin_EAPT_PAIRING_IS_NOT_ENABLED">EAPT_PAIRING_IS_NOT_ENABLED</a>: u64 = 28;
1043-
</code></pre>
1044-
1045-
1046-
10471037
<a id="0x1_coin_EBURN_REF_NOT_FOUND"></a>
10481038

10491039
The BurnRef does not exist.
@@ -1254,6 +1244,16 @@ PairedFungibleAssetRefs resource does not exist.
12541244

12551245

12561246

1247+
<a id="0x1_coin_ESUP_PAIRING_IS_NOT_ENABLED"></a>
1248+
1249+
SUPRA pairing is not eanbled yet.
1250+
1251+
1252+
<pre><code><b>const</b> <a href="coin.md#0x1_coin_ESUP_PAIRING_IS_NOT_ENABLED">ESUP_PAIRING_IS_NOT_ENABLED</a>: u64 = 28;
1253+
</code></pre>
1254+
1255+
1256+
12571257
<a id="0x1_coin_ETRANSFER_REF_NOT_FOUND"></a>
12581258

12591259
The TransferRef does not exist.
@@ -1375,6 +1375,9 @@ Create SUPRA pairing by passing <code>SupraCoin</code>.
13751375
supra_framework: &<a href="../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer">signer</a>
13761376
) <b>acquires</b> <a href="coin.md#0x1_coin_CoinConversionMap">CoinConversionMap</a>, <a href="coin.md#0x1_coin_CoinInfo">CoinInfo</a> {
13771377
<a href="system_addresses.md#0x1_system_addresses_assert_supra_framework">system_addresses::assert_supra_framework</a>(supra_framework);
1378+
<b>if</b> (!<a href="../../aptos-stdlib/../move-stdlib/doc/features.md#0x1_features_coin_to_fungible_asset_migration_feature_enabled">features::coin_to_fungible_asset_migration_feature_enabled</a>()) {
1379+
<b>abort</b> <a href="../../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error_unavailable">error::unavailable</a>(<a href="coin.md#0x1_coin_ECOIN_TO_FUNGIBLE_ASSET_FEATURE_NOT_ENABLED">ECOIN_TO_FUNGIBLE_ASSET_FEATURE_NOT_ENABLED</a>)
1380+
};
13781381
<a href="coin.md#0x1_coin_create_and_return_paired_metadata_if_not_exist">create_and_return_paired_metadata_if_not_exist</a>&lt;CoinType&gt;(<b>true</b>);
13791382
}
13801383
</code></pre>
@@ -1413,7 +1416,7 @@ Create SUPRA pairing by passing <code>SupraCoin</code>.
14131416

14141417

14151418

1416-
<pre><code><b>fun</b> <a href="coin.md#0x1_coin_create_and_return_paired_metadata_if_not_exist">create_and_return_paired_metadata_if_not_exist</a>&lt;CoinType&gt;(allow_apt_creation: bool): <a href="object.md#0x1_object_Object">object::Object</a>&lt;<a href="fungible_asset.md#0x1_fungible_asset_Metadata">fungible_asset::Metadata</a>&gt;
1419+
<pre><code><b>fun</b> <a href="coin.md#0x1_coin_create_and_return_paired_metadata_if_not_exist">create_and_return_paired_metadata_if_not_exist</a>&lt;CoinType&gt;(allow_sup_creation: bool): <a href="object.md#0x1_object_Object">object::Object</a>&lt;<a href="fungible_asset.md#0x1_fungible_asset_Metadata">fungible_asset::Metadata</a>&gt;
14171420
</code></pre>
14181421

14191422

@@ -1422,7 +1425,7 @@ Create SUPRA pairing by passing <code>SupraCoin</code>.
14221425
<summary>Implementation</summary>
14231426

14241427

1425-
<pre><code>inline <b>fun</b> <a href="coin.md#0x1_coin_create_and_return_paired_metadata_if_not_exist">create_and_return_paired_metadata_if_not_exist</a>&lt;CoinType&gt;(allow_apt_creation: bool): Object&lt;Metadata&gt; {
1428+
<pre><code>inline <b>fun</b> <a href="coin.md#0x1_coin_create_and_return_paired_metadata_if_not_exist">create_and_return_paired_metadata_if_not_exist</a>&lt;CoinType&gt;(allow_sup_creation: bool): Object&lt;Metadata&gt; {
14261429
<b>assert</b>!(
14271430
<a href="../../aptos-stdlib/../move-stdlib/doc/features.md#0x1_features_coin_to_fungible_asset_migration_feature_enabled">features::coin_to_fungible_asset_migration_feature_enabled</a>(),
14281431
<a href="../../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error_invalid_state">error::invalid_state</a>(<a href="coin.md#0x1_coin_EMIGRATION_FRAMEWORK_NOT_ENABLED">EMIGRATION_FRAMEWORK_NOT_ENABLED</a>)
@@ -1432,13 +1435,13 @@ Create SUPRA pairing by passing <code>SupraCoin</code>.
14321435
<b>let</b> type = <a href="../../aptos-stdlib/doc/type_info.md#0x1_type_info_type_of">type_info::type_of</a>&lt;CoinType&gt;();
14331436
<b>if</b> (!<a href="../../aptos-stdlib/doc/table.md#0x1_table_contains">table::contains</a>(&map.coin_to_fungible_asset_map, type)) {
14341437
<b>let</b> is_sup = <a href="coin.md#0x1_coin_is_sup">is_sup</a>&lt;CoinType&gt;();
1435-
<b>assert</b>!(!is_sup || allow_apt_creation, <a href="../../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error_invalid_state">error::invalid_state</a>(<a href="coin.md#0x1_coin_EAPT_PAIRING_IS_NOT_ENABLED">EAPT_PAIRING_IS_NOT_ENABLED</a>));
1438+
<b>assert</b>!(!is_sup || allow_sup_creation, <a href="../../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error_invalid_state">error::invalid_state</a>(<a href="coin.md#0x1_coin_ESUP_PAIRING_IS_NOT_ENABLED">ESUP_PAIRING_IS_NOT_ENABLED</a>));
14361439
<b>let</b> metadata_object_cref =
14371440
<b>if</b> (is_sup) {
1438-
<a href="object.md#0x1_object_create_sticky_object_at_address">object::create_sticky_object_at_address</a>(@supra_framework, @aptos_fungible_asset)
1441+
<a href="object.md#0x1_object_create_sticky_object_at_address">object::create_sticky_object_at_address</a>(@supra_framework, @supra_fungible_asset)
14391442
} <b>else</b> {
14401443
<a href="object.md#0x1_object_create_named_object">object::create_named_object</a>(
1441-
&<a href="create_signer.md#0x1_create_signer_create_signer">create_signer::create_signer</a>(@aptos_fungible_asset),
1444+
&<a href="create_signer.md#0x1_create_signer_create_signer">create_signer::create_signer</a>(@supra_fungible_asset),
14421445
*<a href="../../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_bytes">string::bytes</a>(&<a href="../../aptos-stdlib/doc/type_info.md#0x1_type_info_type_name">type_info::type_name</a>&lt;CoinType&gt;())
14431446
)
14441447
};
@@ -1558,16 +1561,10 @@ Conversion from coin to fungible asset
15581561
<pre><code><b>public</b> <b>fun</b> <a href="coin.md#0x1_coin_coin_to_fungible_asset">coin_to_fungible_asset</a>&lt;CoinType&gt;(
15591562
<a href="coin.md#0x1_coin">coin</a>: <a href="coin.md#0x1_coin_Coin">Coin</a>&lt;CoinType&gt;
15601563
): FungibleAsset <b>acquires</b> <a href="coin.md#0x1_coin_CoinConversionMap">CoinConversionMap</a>, <a href="coin.md#0x1_coin_CoinInfo">CoinInfo</a> {
1561-
// TODO: Replace the below <a href="code.md#0x1_code">code</a> <b>with</b> a call <b>to</b> `coin_to_fungible_asset_internal`
1562-
// once we fully support `FungibleAsset`s. The below guard is used because we need <b>to</b>
1563-
// preserve the function signature but want <b>to</b> keep the feature flag active <b>to</b> avoid
1564-
// breaking the tests. The `<b>else</b>` branch will never be taken in the production <a href="code.md#0x1_code">code</a>
1565-
// <b>as</b> this feature is set by default.
1566-
<b>if</b> (<a href="../../aptos-stdlib/../move-stdlib/doc/features.md#0x1_features_coin_to_fungible_asset_migration_feature_enabled">features::coin_to_fungible_asset_migration_feature_enabled</a>()) {
1564+
<b>if</b> (!<a href="../../aptos-stdlib/../move-stdlib/doc/features.md#0x1_features_coin_to_fungible_asset_migration_feature_enabled">features::coin_to_fungible_asset_migration_feature_enabled</a>()) {
15671565
<b>abort</b> <a href="../../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error_unavailable">error::unavailable</a>(<a href="coin.md#0x1_coin_ECOIN_TO_FUNGIBLE_ASSET_FEATURE_NOT_ENABLED">ECOIN_TO_FUNGIBLE_ASSET_FEATURE_NOT_ENABLED</a>)
1568-
} <b>else</b> {
1569-
<a href="coin.md#0x1_coin_coin_to_fungible_asset_internal">coin_to_fungible_asset_internal</a>(<a href="coin.md#0x1_coin">coin</a>)
1570-
}
1566+
};
1567+
<a href="coin.md#0x1_coin_coin_to_fungible_asset_internal">coin_to_fungible_asset_internal</a>(<a href="coin.md#0x1_coin">coin</a>)
15711568
}
15721569
</code></pre>
15731570

@@ -2367,16 +2364,10 @@ Voluntarily migrate to fungible store for <code>CoinType</code> if not yet.
23672364
<pre><code><b>public</b> entry <b>fun</b> <a href="coin.md#0x1_coin_migrate_to_fungible_store">migrate_to_fungible_store</a>&lt;CoinType&gt;(
23682365
<a href="account.md#0x1_account">account</a>: &<a href="../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer">signer</a>
23692366
) <b>acquires</b> <a href="coin.md#0x1_coin_CoinStore">CoinStore</a>, <a href="coin.md#0x1_coin_CoinConversionMap">CoinConversionMap</a>, <a href="coin.md#0x1_coin_CoinInfo">CoinInfo</a> {
2370-
// TODO: Replace the below <a href="code.md#0x1_code">code</a> <b>with</b> a call <b>to</b> `migrate_to_fungible_store_internal`
2371-
// once we fully support `FungibleAsset`s. The below guard is used because we need <b>to</b>
2372-
// preserve the function signature but want <b>to</b> keep the feature flag active <b>to</b> avoid
2373-
// breaking the tests. The `<b>else</b>` branch will never be taken in the production <a href="code.md#0x1_code">code</a>
2374-
// <b>as</b> this feature is set by default.
2375-
<b>if</b> (<a href="../../aptos-stdlib/../move-stdlib/doc/features.md#0x1_features_coin_to_fungible_asset_migration_feature_enabled">features::coin_to_fungible_asset_migration_feature_enabled</a>()) {
2367+
<b>if</b> (!<a href="../../aptos-stdlib/../move-stdlib/doc/features.md#0x1_features_coin_to_fungible_asset_migration_feature_enabled">features::coin_to_fungible_asset_migration_feature_enabled</a>()) {
23762368
<b>abort</b> <a href="../../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error_unavailable">error::unavailable</a>(<a href="coin.md#0x1_coin_ECOIN_TO_FUNGIBLE_ASSET_FEATURE_NOT_ENABLED">ECOIN_TO_FUNGIBLE_ASSET_FEATURE_NOT_ENABLED</a>)
2377-
} <b>else</b> {
2378-
<a href="coin.md#0x1_coin_migrate_to_fungible_store_internal">migrate_to_fungible_store_internal</a>&lt;CoinType&gt;(<a href="account.md#0x1_account">account</a>)
2379-
}
2369+
};
2370+
<a href="coin.md#0x1_coin_migrate_to_fungible_store_internal">migrate_to_fungible_store_internal</a>&lt;CoinType&gt;(<a href="account.md#0x1_account">account</a>)
23802371
}
23812372
</code></pre>
23822373

aptos-move/framework/supra-framework/doc/fungible_asset.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -802,16 +802,6 @@ Cannot destroy non-empty fungible assets.
802802

803803

804804

805-
<a id="0x1_fungible_asset_EAPT_NOT_DISPATCHABLE"></a>
806-
807-
Cannot register dispatch hook for SUPRA.
808-
809-
810-
<pre><code><b>const</b> <a href="fungible_asset.md#0x1_fungible_asset_EAPT_NOT_DISPATCHABLE">EAPT_NOT_DISPATCHABLE</a>: u64 = 31;
811-
</code></pre>
812-
813-
814-
815805
<a id="0x1_fungible_asset_EBALANCE_IS_NOT_ZERO"></a>
816806

817807
Cannot destroy fungible stores with a non-zero balance.
@@ -1043,6 +1033,16 @@ The fungible asset's supply will be negative which should be impossible.
10431033

10441034

10451035

1036+
<a id="0x1_fungible_asset_ESUP_NOT_DISPATCHABLE"></a>
1037+
1038+
Cannot register dispatch hook for SUPRA.
1039+
1040+
1041+
<pre><code><b>const</b> <a href="fungible_asset.md#0x1_fungible_asset_ESUP_NOT_DISPATCHABLE">ESUP_NOT_DISPATCHABLE</a>: u64 = 31;
1042+
</code></pre>
1043+
1044+
1045+
10461046
<a id="0x1_fungible_asset_ESYMBOL_TOO_LONG"></a>
10471047

10481048
Symbol of the fungible asset metadata is too long
@@ -1406,8 +1406,8 @@ Create a fungible asset store whose transfer rule would be overloaded by the pro
14061406

14071407
// Cannot register hook for SUPRA.
14081408
<b>assert</b>!(
1409-
<a href="object.md#0x1_object_address_from_constructor_ref">object::address_from_constructor_ref</a>(constructor_ref) != @aptos_fungible_asset,
1410-
<a href="../../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error_permission_denied">error::permission_denied</a>(<a href="fungible_asset.md#0x1_fungible_asset_EAPT_NOT_DISPATCHABLE">EAPT_NOT_DISPATCHABLE</a>)
1409+
<a href="object.md#0x1_object_address_from_constructor_ref">object::address_from_constructor_ref</a>(constructor_ref) != @supra_fungible_asset,
1410+
<a href="../../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error_permission_denied">error::permission_denied</a>(<a href="fungible_asset.md#0x1_fungible_asset_ESUP_NOT_DISPATCHABLE">ESUP_NOT_DISPATCHABLE</a>)
14111411
);
14121412
<b>assert</b>!(
14131413
!<a href="object.md#0x1_object_can_generate_delete_ref">object::can_generate_delete_ref</a>(constructor_ref),
@@ -2143,7 +2143,7 @@ Return whether a fungible asset type is dispatchable.
21432143
<pre><code><b>fun</b> <a href="fungible_asset.md#0x1_fungible_asset_has_deposit_dispatch_function">has_deposit_dispatch_function</a>(metadata: Object&lt;<a href="fungible_asset.md#0x1_fungible_asset_Metadata">Metadata</a>&gt;): bool <b>acquires</b> <a href="fungible_asset.md#0x1_fungible_asset_DispatchFunctionStore">DispatchFunctionStore</a> {
21442144
<b>let</b> metadata_addr = <a href="object.md#0x1_object_object_address">object::object_address</a>(&metadata);
21452145
// Short circuit on SUPRA for better perf
2146-
<b>if</b>(metadata_addr != @aptos_fungible_asset && <b>exists</b>&lt;<a href="fungible_asset.md#0x1_fungible_asset_DispatchFunctionStore">DispatchFunctionStore</a>&gt;(metadata_addr)) {
2146+
<b>if</b>(metadata_addr != @supra_fungible_asset && <b>exists</b>&lt;<a href="fungible_asset.md#0x1_fungible_asset_DispatchFunctionStore">DispatchFunctionStore</a>&gt;(metadata_addr)) {
21472147
<a href="../../aptos-stdlib/../move-stdlib/doc/option.md#0x1_option_is_some">option::is_some</a>(&<b>borrow_global</b>&lt;<a href="fungible_asset.md#0x1_fungible_asset_DispatchFunctionStore">DispatchFunctionStore</a>&gt;(metadata_addr).deposit_function)
21482148
} <b>else</b> {
21492149
<b>false</b>
@@ -2203,7 +2203,7 @@ Return whether a fungible asset type is dispatchable.
22032203
<pre><code><b>fun</b> <a href="fungible_asset.md#0x1_fungible_asset_has_withdraw_dispatch_function">has_withdraw_dispatch_function</a>(metadata: Object&lt;<a href="fungible_asset.md#0x1_fungible_asset_Metadata">Metadata</a>&gt;): bool <b>acquires</b> <a href="fungible_asset.md#0x1_fungible_asset_DispatchFunctionStore">DispatchFunctionStore</a> {
22042204
<b>let</b> metadata_addr = <a href="object.md#0x1_object_object_address">object::object_address</a>(&metadata);
22052205
// Short circuit on SUPRA for better perf
2206-
<b>if</b> (metadata_addr != @aptos_fungible_asset && <b>exists</b>&lt;<a href="fungible_asset.md#0x1_fungible_asset_DispatchFunctionStore">DispatchFunctionStore</a>&gt;(metadata_addr)) {
2206+
<b>if</b> (metadata_addr != @supra_fungible_asset && <b>exists</b>&lt;<a href="fungible_asset.md#0x1_fungible_asset_DispatchFunctionStore">DispatchFunctionStore</a>&gt;(metadata_addr)) {
22072207
<a href="../../aptos-stdlib/../move-stdlib/doc/option.md#0x1_option_is_some">option::is_some</a>(&<b>borrow_global</b>&lt;<a href="fungible_asset.md#0x1_fungible_asset_DispatchFunctionStore">DispatchFunctionStore</a>&gt;(metadata_addr).withdraw_function)
22082208
} <b>else</b> {
22092209
<b>false</b>

0 commit comments

Comments
 (0)