Skip to content

Commit

Permalink
bump movevm v0.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
initia-infra committed Nov 21, 2024
1 parent aaa0b87 commit 77d5f3e
Show file tree
Hide file tree
Showing 94 changed files with 5,097 additions and 712 deletions.
1 change: 1 addition & 0 deletions initia_stdlib/Move.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ MoveNursery = { local = "../move_nursery" }
std = "0x1"
initia_std = "0x1"
relayer = "0x3d18d54532fc42e567090852db6eb21fa528f952"
cafe = "0xcafe"
2 changes: 1 addition & 1 deletion initia_stdlib/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Initia Standar Library
# Initia Standard Library

The Initia standard library defines stardarads, types and util modules of Initia.

Expand Down
6 changes: 3 additions & 3 deletions initia_stdlib/doc/coin.md
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ Only fungible asset metadata owner can make changes.

## Function `mint`

Mint FAs as the owner of metadat object.
Mint FAs as the owner of metadata object.


<pre><code><b>public</b> <b>fun</b> <a href="coin.md#0x1_coin_mint">mint</a>(mint_cap: &<a href="coin.md#0x1_coin_MintCapability">coin::MintCapability</a>, amount: u64): <a href="fungible_asset.md#0x1_fungible_asset_FungibleAsset">fungible_asset::FungibleAsset</a>
Expand Down Expand Up @@ -506,7 +506,7 @@ Mint FAs as the owner of metadat object.

## Function `mint_to`

Mint FAs as the owner of metadat object to the primary fungible store of the given recipient.
Mint FAs as the owner of metadata object to the primary fungible store of the given recipient.


<pre><code><b>public</b> <b>fun</b> <a href="coin.md#0x1_coin_mint_to">mint_to</a>(mint_cap: &<a href="coin.md#0x1_coin_MintCapability">coin::MintCapability</a>, recipient: <b>address</b>, amount: u64)
Expand Down Expand Up @@ -539,7 +539,7 @@ Mint FAs as the owner of metadat object to the primary fungible store of the giv

## Function `burn`

Burn FAs as the owner of metadat object.
Burn FAs as the owner of metadata object.


<pre><code><b>public</b> <b>fun</b> <a href="coin.md#0x1_coin_burn">burn</a>(burn_cap: &<a href="coin.md#0x1_coin_BurnCapability">coin::BurnCapability</a>, fa: <a href="fungible_asset.md#0x1_fungible_asset_FungibleAsset">fungible_asset::FungibleAsset</a>)
Expand Down
2 changes: 1 addition & 1 deletion initia_stdlib/doc/collection.md
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ Provides the count of the current selection if supply tracking is used
## Function `nfts`

get nft list from collection
if <code>start_after</code> is not none, seach nfts in range (start_after, ...]
if <code>start_after</code> is not none, search nfts in range (start_after, ...]


<pre><code>#[view]
Expand Down
2 changes: 1 addition & 1 deletion initia_stdlib/doc/dex.md
Original file line number Diff line number Diff line change
Expand Up @@ -2584,7 +2584,7 @@ CONTRACT: not allow until LBP is ended

## Function `single_asset_provide_liquidity`

Signle asset provide liquidity directly
Single asset provide liquidity directly
CONTRACT: cannot provide more than the pool amount to prevent huge price impact
CONTRACT: not allow until LBP is ended

Expand Down
4 changes: 2 additions & 2 deletions initia_stdlib/doc/dispatchable_fungible_asset.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The dispatchable_fungible_asset wraps the existing fungible_asset module and add
to customize the logic for withdraw and deposit operations. For example:

- Deflation token: a fixed percentage of token will be destructed upon transfer.
- Transfer allowlist: token can only be transfered to addresses in the allow list.
- Transfer allowlist: token can only be transferred to addresses in the allow list.
- Predicated transfer: transfer can only happen when some certain predicate has been met.
- Loyalty token: a fixed loyalty will be paid to a designated address when a fungible asset transfer happens

Expand Down Expand Up @@ -285,7 +285,7 @@ Note: it does not move the underlying object.
## Function `transfer_assert_minimum_deposit`

Transfer an <code>amount</code> of fungible asset from <code>from_store</code>, which should be owned by <code>sender</code>, to <code>receiver</code>.
The recipient is guranteed to receive asset greater than the expected amount.
The recipient is guaranteed to receive asset greater than the expected amount.
Note: it does not move the underlying object.


Expand Down
2 changes: 1 addition & 1 deletion initia_stdlib/doc/ed25519.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ The size of a serialized signature, in bytes.

## Function `public_key_from_bytes`

Contructs an PublicKey struct, given 32-byte representation.
Constructs an PublicKey struct, given 32-byte representation.


<pre><code><b>public</b> <b>fun</b> <a href="ed25519.md#0x1_ed25519_public_key_from_bytes">public_key_from_bytes</a>(bytes: <a href="../../move_nursery/../move_stdlib/doc/vector.md#0x1_vector">vector</a>&lt;u8&gt;): <a href="ed25519.md#0x1_ed25519_PublicKey">ed25519::PublicKey</a>
Expand Down
2 changes: 1 addition & 1 deletion initia_stdlib/doc/fungible_asset.md
Original file line number Diff line number Diff line change
Expand Up @@ -1301,7 +1301,7 @@ This can only be called at object creation time as constructor_ref is only avail

## Function `is_fungible_asset`

Retrun true if given address has Metadata else return false
Return true if given address has Metadata else return false


<pre><code>#[view]
Expand Down
2 changes: 1 addition & 1 deletion initia_stdlib/doc/math128.md
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ Returns square root of x, precisely floor(sqrt(x))
<b>let</b> res = 1 &lt;&lt; ((<a href="math128.md#0x1_math128_floor_log2">floor_log2</a>(x) + 1) &gt;&gt; 1);
// We <b>use</b> standard newton-rhapson iteration <b>to</b> improve the initial approximation.
// The <a href="../../move_nursery/../move_stdlib/doc/error.md#0x1_error">error</a> term evolves <b>as</b> delta_i+1 = delta_i^2 / 2 (quadratic convergence).
// It turns out that after 5 iterations the delta is smaller than 2^-64 and thus below the treshold.
// It turns out that after 5 iterations the delta is smaller than 2^-64 and thus below the threshold.
res = (res + x / res) &gt;&gt; 1;
res = (res + x / res) &gt;&gt; 1;
res = (res + x / res) &gt;&gt; 1;
Expand Down
2 changes: 1 addition & 1 deletion initia_stdlib/doc/math64.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ Returns square root of x, precisely floor(sqrt(x))
<b>let</b> res = 1 &lt;&lt; ((<a href="math64.md#0x1_math64_floor_log2">floor_log2</a>(x) + 1) &gt;&gt; 1);
// We <b>use</b> standard newton-rhapson iteration <b>to</b> improve the initial approximation.
// The <a href="../../move_nursery/../move_stdlib/doc/error.md#0x1_error">error</a> term evolves <b>as</b> delta_i+1 = delta_i^2 / 2 (quadratic convergence).
// It turns out that after 4 iterations the delta is smaller than 2^-32 and thus below the treshold.
// It turns out that after 4 iterations the delta is smaller than 2^-32 and thus below the threshold.
res = (res + x / res) &gt;&gt; 1;
res = (res + x / res) &gt;&gt; 1;
res = (res + x / res) &gt;&gt; 1;
Expand Down
4 changes: 2 additions & 2 deletions initia_stdlib/doc/minitswap.md
Original file line number Diff line number Diff line change
Expand Up @@ -3962,7 +3962,7 @@ Event emitted when arb reverted
<a href="../../move_nursery/../move_stdlib/doc/error.md#0x1_error_invalid_state">error::invalid_state</a>(<a href="minitswap.md#0x1_minitswap_EEMERGENCY">EEMERGENCY</a>)
);

// check metdata
// check metadata
<b>let</b> share_token_metadata = <a href="fungible_asset.md#0x1_fungible_asset_metadata_from_asset">fungible_asset::metadata_from_asset</a>(&share_token);
<b>assert</b>!(
share_token_metadata == <a href="minitswap.md#0x1_minitswap_share_token_metadata">share_token_metadata</a>(),
Expand Down Expand Up @@ -4366,7 +4366,7 @@ Event emitted when arb reverted
// and then calculate arb fee and get actual <b>return</b> amount which is same <b>with</b> return_amount_before_swap_fee - swap_fee_amount - arb_fee_amount
// <b>to</b> make actual <b>return</b> amount <b>to</b> <b>return</b> amount, set return_amount_before_swap_fee = return_amount_before_swap_fee + return_diff
// <b>where</b> return_diff = target <b>return</b> amount - actual <b>return</b> amount
// and recalculate offer amount repeatly until <b>return</b> amount &lt;= actual <b>return</b> amount
// and recalculate offer amount repeatedly until <b>return</b> amount &lt;= actual <b>return</b> amount
// note that actual <b>return</b> is always small or equal <b>with</b> target <b>return</b> amount

// adjust fee. <b>return</b> amount before swap fee = <b>return</b> amount * 1 / (1 - f)
Expand Down
2 changes: 1 addition & 1 deletion initia_stdlib/doc/nft.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ a small optimization to support either and take a fixed amount of 34-bytes.

## Struct `MutatorRef`

This enables mutating descritpion and URI by higher level services.
This enables mutating description and URI by higher level services.


<pre><code><b>struct</b> <a href="nft.md#0x1_nft_MutatorRef">MutatorRef</a> <b>has</b> drop, store
Expand Down
2 changes: 1 addition & 1 deletion initia_stdlib/doc/object.md
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ The version of ref does not match with object core version.

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

Maximum nesting from one object to another. That is objects can technically have infinte
Maximum nesting from one object to another. That is objects can technically have infinite
nesting, but any checks such as transfer will only be evaluated this deep.


Expand Down
2 changes: 1 addition & 1 deletion initia_stdlib/doc/primary_fungible_store.md
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ Transfer <code>amount</code> of fungible asset from sender's primary store to re
## Function `transfer_assert_minimum_deposit`

Transfer <code>amount</code> of fungible asset from sender's primary store to receiver's primary store.
Use the minimum deposit assertion api to make sure receipient will receive a minimum amount of fund.
Use the minimum deposit assertion api to make sure recipient will receive a minimum amount of fund.


<pre><code><b>public</b> entry <b>fun</b> <a href="primary_fungible_store.md#0x1_primary_fungible_store_transfer_assert_minimum_deposit">transfer_assert_minimum_deposit</a>&lt;T: key&gt;(sender: &<a href="../../move_nursery/../move_stdlib/doc/signer.md#0x1_signer">signer</a>, metadata: <a href="object.md#0x1_object_Object">object::Object</a>&lt;T&gt;, recipient: <b>address</b>, amount: u64, expected: u64)
Expand Down
2 changes: 1 addition & 1 deletion initia_stdlib/doc/property_map.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ Maximum number of characters in a property name
## Function `burn`

Burns the entire property map
TODO: hanlde when table is not empty
TODO: handle when table is not empty


<pre><code><b>public</b> <b>fun</b> <a href="property_map.md#0x1_property_map_burn">burn</a>(ref: <a href="property_map.md#0x1_property_map_MutatorRef">property_map::MutatorRef</a>)
Expand Down
2 changes: 1 addition & 1 deletion initia_stdlib/doc/stableswap.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
<code>extend_ref: <a href="object.md#0x1_object_ExtendRef">object::ExtendRef</a></code>
</dt>
<dd>
Extend Refernce
Extend Reference
</dd>
<dt>
<code>ann: <a href="stableswap.md#0x1_stableswap_Ann">stableswap::Ann</a></code>
Expand Down
8 changes: 4 additions & 4 deletions initia_stdlib/doc/staking.md
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ util function to convert Unbonding => UnbondingResponse for third party queriers

## Function `get_delegation`

Get delegation info of specifed addr and validator
Get delegation info of specified addr and validator


<pre><code>#[view]
Expand Down Expand Up @@ -2116,7 +2116,7 @@ Get <code>share</code> from <code><a href="staking.md#0x1_staking_Delegation">De

## Function `destroy_empty_delegation`

Destory empty delegation
Destroy empty delegation


<pre><code><b>public</b> <b>fun</b> <a href="staking.md#0x1_staking_destroy_empty_delegation">destroy_empty_delegation</a>(delegation: <a href="staking.md#0x1_staking_Delegation">staking::Delegation</a>)
Expand Down Expand Up @@ -2485,7 +2485,7 @@ Get <code>unbonding_amount</code> from <code><a href="staking.md#0x1_staking_Unb

## Function `destroy_empty_unbonding`

Destory empty unbonding
Destroy empty unbonding


<pre><code><b>public</b> <b>fun</b> <a href="staking.md#0x1_staking_destroy_empty_unbonding">destroy_empty_unbonding</a>(unbonding: <a href="staking.md#0x1_staking_Unbonding">staking::Unbonding</a>)
Expand Down Expand Up @@ -2576,7 +2576,7 @@ Deposit the unbonding into recipient's account.

## Function `withdraw_unbonding`

Withdraw specifed <code>amount</code> of unbonding_amount from the unbonding.
Withdraw specified <code>amount</code> of unbonding_amount from the unbonding.


<pre><code><b>public</b> <b>fun</b> <a href="staking.md#0x1_staking_withdraw_unbonding">withdraw_unbonding</a>(<a href="account.md#0x1_account">account</a>: &<a href="../../move_nursery/../move_stdlib/doc/signer.md#0x1_signer">signer</a>, metadata: <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;, validator: <a href="../../move_nursery/../move_stdlib/doc/string.md#0x1_string_String">string::String</a>, release_time: u64, amount: u64): <a href="staking.md#0x1_staking_Unbonding">staking::Unbonding</a>
Expand Down
2 changes: 1 addition & 1 deletion initia_stdlib/sources/address.move
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ module initia_std::address {
assert!(addr == from_sdk(addr_sdk), 0)
}

// string <> address
// hex string <> address
native public fun to_string(addr: address): String;
native public fun from_string(addr_str: String): address;

Expand Down
2 changes: 1 addition & 1 deletion initia_stdlib/sources/bech32.move
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ module initia_std::bech32 {
assert!(prefix == string::utf8(b"celestia"), 2);
assert!(data == x"12eafdba79c3dd7b90e3712ee475423153a722c7", 3);
}
}
}
Loading

0 comments on commit 77d5f3e

Please sign in to comment.