We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
暴露两个方法 burn 和 mint,这两个方法只能合约发起者进行执行
burn
mint
module move_coin::ZCDCCOIN { use sui::coin::{Self, Coin, TreasuryCap}; use sui::url; public struct ZCDCCOIN has drop {} /// Module initializer is called once on module publish. A treasury /// cap is sent to the publisher, who then controls minting and burning fun init(witness: ZCDCCOIN, ctx: &mut TxContext) { let (treasury, metadata) = coin::create_currency( witness, 6, b"ZCDCCoin", b"ZCDCCoin", b"ZCDCCoin is NO.1", option::some(url::new_unsafe_from_bytes(b"https://aggregator.walrus-testnet.walrus.space/v1/n-e_Ni4LwoBJUwu_Ovccl7Lflh_NmHmvwMpLWLRwCt0")), ctx ); transfer::public_freeze_object(metadata); transfer::public_transfer(treasury, tx_context::sender(ctx)); } public entry fun mint ( treasury_cap: &mut TreasuryCap<ZCDCCOIN>, amount: u64, recipient: address, ctx: &mut TxContext ) { coin::mint_and_transfer(treasury_cap, amount, recipient, ctx) } public entry fun burn ( treasury_cap: &mut TreasuryCap<ZCDCCOIN>, coin: Coin<ZCDCCOIN> ) { coin::burn(treasury_cap, coin); } }
sui move build sui client publish
记录下TreasuryCap的objectid 用于mint币
TreasuryCap
https://suiscan.xyz/testnet/object/0x14789a6e47d1c1a11890e9315daa666079745b9df3f3618ab9f6ec820da9f9d3/contracts
第一个参数写刚刚记录的objectid,第二个写币的数量,第三个写你的钱包地址
The text was updated successfully, but these errors were encountered:
No branches or pull requests
合约
暴露两个方法
burn
和mint
,这两个方法只能合约发起者进行执行打包发布合约
记录下
TreasuryCap
的objectid 用于mint币mint币
https://suiscan.xyz/testnet/object/0x14789a6e47d1c1a11890e9315daa666079745b9df3f3618ab9f6ec820da9f9d3/contracts
第一个参数写刚刚记录的objectid,第二个写币的数量,第三个写你的钱包地址
查看币
The text was updated successfully, but these errors were encountered: