{ "casper_contract_schema_version": 1, "toolchain": "rustc 1.79.0-nightly (3a36386dc 2024-04-25)", "authors": [ "Jakub Płaskonka ", "Krzysztof Pobiarżyn ", "Maciej Zieliński " ], "repository": "https://github.com/odradev/odra", "homepage": null, "contract_name": "Erc20", "contract_version": "1.2.0", "types": [ { "struct": { "name": "Approval", "description": null, "members": [ { "name": "owner", "description": null, "ty": "Key" }, { "name": "spender", "description": null, "ty": "Key" }, { "name": "value", "description": null, "ty": "U256" } ] } }, { "struct": { "name": "Transfer", "description": null, "members": [ { "name": "from", "description": null, "ty": { "Option": "Key" } }, { "name": "to", "description": null, "ty": { "Option": "Key" } }, { "name": "amount", "description": null, "ty": "U256" } ] } } ], "errors": [ { "name": "DecimalsNotSet", "description": "Decimals not set", "discriminant": 30004 }, { "name": "InsufficientAllowance", "description": "Insufficient allowance", "discriminant": 30001 }, { "name": "InsufficientBalance", "description": "Insufficient balance", "discriminant": 30000 }, { "name": "NameNotSet", "description": "Name not set", "discriminant": 30002 }, { "name": "SymbolNotSet", "description": "Symbol not set", "discriminant": 30003 } ], "entry_points": [ { "name": "transfer", "description": "Transfers tokens from the caller to the recipient.", "is_mutable": true, "arguments": [ { "name": "recipient", "description": null, "ty": "Key", "optional": false }, { "name": "amount", "description": null, "ty": "U256", "optional": false } ], "return_ty": "Unit", "is_contract_context": true, "access": "public" }, { "name": "transfer_from", "description": "Transfers tokens from the owner to the recipient using the spender's allowance.", "is_mutable": true, "arguments": [ { "name": "owner", "description": null, "ty": "Key", "optional": false }, { "name": "recipient", "description": null, "ty": "Key", "optional": false }, { "name": "amount", "description": null, "ty": "U256", "optional": false } ], "return_ty": "Unit", "is_contract_context": true, "access": "public" }, { "name": "approve", "description": "Approves the spender to spend the given amount of tokens on behalf of the caller.", "is_mutable": true, "arguments": [ { "name": "spender", "description": null, "ty": "Key", "optional": false }, { "name": "amount", "description": null, "ty": "U256", "optional": false } ], "return_ty": "Unit", "is_contract_context": true, "access": "public" }, { "name": "name", "description": "Returns the name of the token.", "is_mutable": false, "arguments": [], "return_ty": "String", "is_contract_context": true, "access": "public" }, { "name": "symbol", "description": "Returns the symbol of the token.", "is_mutable": false, "arguments": [], "return_ty": "String", "is_contract_context": true, "access": "public" }, { "name": "decimals", "description": "Returns the number of decimals the token uses.", "is_mutable": false, "arguments": [], "return_ty": "U8", "is_contract_context": true, "access": "public" }, { "name": "total_supply", "description": "Returns the total supply of the token.", "is_mutable": false, "arguments": [], "return_ty": "U256", "is_contract_context": true, "access": "public" }, { "name": "balance_of", "description": "Returns the balance of the given address.", "is_mutable": false, "arguments": [ { "name": "address", "description": null, "ty": "Key", "optional": false } ], "return_ty": "U256", "is_contract_context": true, "access": "public" }, { "name": "allowance", "description": "Returns the amount of tokens the owner has allowed the spender to spend.", "is_mutable": false, "arguments": [ { "name": "owner", "description": null, "ty": "Key", "optional": false }, { "name": "spender", "description": null, "ty": "Key", "optional": false } ], "return_ty": "U256", "is_contract_context": true, "access": "public" }, { "name": "mint", "description": "Mints new tokens and assigns them to the given address.", "is_mutable": true, "arguments": [ { "name": "address", "description": null, "ty": "Key", "optional": false }, { "name": "amount", "description": null, "ty": "U256", "optional": false } ], "return_ty": "Unit", "is_contract_context": true, "access": "public" }, { "name": "burn", "description": "Burns the given amount of tokens from the given address.", "is_mutable": true, "arguments": [ { "name": "address", "description": null, "ty": "Key", "optional": false }, { "name": "amount", "description": null, "ty": "U256", "optional": false } ], "return_ty": "Unit", "is_contract_context": true, "access": "public" } ], "events": [ { "name": "Approval", "ty": "Approval" }, { "name": "Transfer", "ty": "Transfer" } ], "call": { "wasm_file_name": "Erc20.wasm", "description": "Initializes the contract with the given metadata and initial supply.", "arguments": [ { "name": "odra_cfg_package_hash_key_name", "description": "The arg name for the package hash key name.", "ty": "String", "optional": false }, { "name": "odra_cfg_allow_key_override", "description": "The arg name for the allow key override.", "ty": "Bool", "optional": false }, { "name": "odra_cfg_is_upgradable", "description": "The arg name for the contract upgradeability setting.", "ty": "Bool", "optional": false }, { "name": "symbol", "description": null, "ty": "String", "optional": false }, { "name": "name", "description": null, "ty": "String", "optional": false }, { "name": "decimals", "description": null, "ty": "U8", "optional": false }, { "name": "initial_supply", "description": null, "ty": { "Option": "U256" }, "optional": false } ] } }