Skip to content

casrou/partisia-example-contract

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Token contract example

This is an example token smart contract.

The contract has a constant total supply of tokens. The total supply is initialized together with the contract.

Any token owner can then transfer tokens to other accounts, or approve other accounts to use their tokens. If a Alice has been approved tokens from Bob, then Alice can use transfer_from to use Bob's tokens.

The contract uses the standard MPC-20 format you can find the specification here

The contract is inspired by the ERC20 token contract: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md

Build the contract

cargo partisia-contract build --release

Deploy to Partisia Testnet

cargo partisia-contract cli tx deploy --privatekey privatekey.txt --gas 2500000 target/wasm32-unknown-unknown/release/token_contract.wasm target/wasm32-unknown-unknown/release/token_contract.abi ExampleCoin EXC 2 10000

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published