{ "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": "WrappedNativeToken", "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": "Deposit", "description": null, "members": [ { "name": "account", "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" } ] } }, { "struct": { "name": "Withdrawal", "description": null, "members": [ { "name": "account", "description": null, "ty": "Key" }, { "name": "value", "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": "deposit", "description": "Deposits native tokens into the contract.", "is_mutable": true, "arguments": [], "return_ty": "Unit", "is_contract_context": true, "access": "public" }, { "name": "withdraw", "description": "Withdraws native tokens from the contract.", "is_mutable": true, "arguments": [ { "name": "amount", "description": null, "ty": "U256", "optional": false } ], "return_ty": "Unit", "is_contract_context": true, "access": "public" }, { "name": "allowance", "description": "Sets the allowance for `spender` to spend `amount` of the caller's tokens.", "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": "balance_of", "description": "Returns the balance of `address`.", "is_mutable": false, "arguments": [ { "name": "address", "description": null, "ty": "Key", "optional": false } ], "return_ty": "U256", "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": "decimals", "description": "Returns the number of decimals used by the token.", "is_mutable": false, "arguments": [], "return_ty": "U8", "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": "name", "description": "Returns the name of the token.", "is_mutable": false, "arguments": [], "return_ty": "String", "is_contract_context": true, "access": "public" }, { "name": "approve", "description": "Approves `spender` to spend `amount` of the caller's tokens.", "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": "transfer_from", "description": "Transfers `amount` of the owners tokens to `recipient` using 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": "transfer", "description": "Transfers `amount` of the caller's tokens to `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" } ], "events": [ { "name": "Approval", "ty": "Approval" }, { "name": "Deposit", "ty": "Deposit" }, { "name": "Transfer", "ty": "Transfer" }, { "name": "Withdrawal", "ty": "Withdrawal" } ], "call": { "wasm_file_name": "WrappedNativeToken.wasm", "description": "Initializes the contract with the metadata.", "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 } ] } }