-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from GuiGou12358/main
add the claim_from method
- Loading branch information
Showing
19 changed files
with
16 additions
and
6,417 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "reward_manager" | ||
version = "1.0.1" | ||
version = "1.1.0" | ||
authors = ["guigou"] | ||
edition = "2021" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
ink/last_verified_artifacts/reward_manager_v1_1_0/bundle.contract
Large diffs are not rendered by default.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
ink/last_verified_artifacts/reward_manager_v1_1_0/contract.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"contract":{"authors":["guigou"],"name":"reward_manager","version":"1.1.0"},"source":{"build_info":{"build_mode":"Release","cargo_contract_version":"3.2.0","rust_toolchain":"stable-x86_64-unknown-linux-gnu","wasm_opt_settings":{"keep_debug_symbols":false,"optimization_passes":"Z"}},"compiler":"rustc 1.71.1","hash":"0xd5ce954d0674b3b68e4896a66a0aa36b7ce4b215c9bdad7730ce97c0fd477436","language":"ink! 4.3.0"},"spec":{"constructors":[{"args":[],"default":false,"docs":[],"label":"new","payable":false,"returnType":{"displayName":["ink_primitives","ConstructorResult"],"type":3},"selector":"0x9bae9d5e"}],"docs":[],"environment":{"accountId":{"displayName":["AccountId"],"type":16},"balance":{"displayName":["Balance"],"type":0},"blockNumber":{"displayName":["BlockNumber"],"type":1},"chainExtension":{"displayName":["ChainExtension"],"type":28},"hash":{"displayName":["Hash"],"type":5},"maxEventTopics":4,"timestamp":{"displayName":["Timestamp"],"type":27}},"events":[{"args":[{"docs":[],"indexed":true,"label":"account","type":{"displayName":["AccountId"],"type":16}},{"docs":[],"indexed":false,"label":"era","type":{"displayName":["u32"],"type":1}},{"docs":[],"indexed":false,"label":"amount","type":{"displayName":["Balance"],"type":0}}],"docs":["Event emitted when a reward is pending"],"label":"PendingReward"},{"args":[{"docs":[],"indexed":true,"label":"account","type":{"displayName":["AccountId"],"type":16}},{"docs":[],"indexed":false,"label":"amount","type":{"displayName":["Balance"],"type":0}}],"docs":["Event emitted when a user claim rewards"],"label":"RewardsClaimed"}],"lang_error":{"displayName":["ink","LangError"],"type":4},"messages":[{"args":[{"label":"new_code_hash","type":{"displayName":["Hash"],"type":5}}],"default":false,"docs":[],"label":"upgrade_contract","mutates":true,"payable":false,"returnType":{"displayName":["ink","MessageResult"],"type":8},"selector":"0x1345543d"},{"args":[],"default":false,"docs":[],"label":"terminate_me","mutates":true,"payable":false,"returnType":{"displayName":["ink","MessageResult"],"type":8},"selector":"0x17feb370"},{"args":[],"default":false,"docs":[],"label":"get_role_reward_manager","mutates":false,"payable":false,"returnType":{"displayName":["ink","MessageResult"],"type":13},"selector":"0xe37044e4"},{"args":[],"default":false,"docs":[],"label":"get_role_claimer_from","mutates":false,"payable":false,"returnType":{"displayName":["ink","MessageResult"],"type":13},"selector":"0x1b25f9bd"},{"args":[],"default":false,"docs":[],"label":"get_role_reward_viewer","mutates":false,"payable":false,"returnType":{"displayName":["ink","MessageResult"],"type":13},"selector":"0x3c40d3be"},{"args":[{"label":"value","type":{"displayName":["Balance"],"type":0}}],"default":false,"docs":[],"label":"withdraw","mutates":true,"payable":false,"returnType":{"displayName":["ink","MessageResult"],"type":8},"selector":"0x410fcc9d"},{"args":[{"label":"era","type":{"displayName":["psp22reward_external","FundRewardsAndAddWinnersInput1"],"type":1}},{"label":"accounts","type":{"displayName":["psp22reward_external","FundRewardsAndAddWinnersInput2"],"type":14}}],"default":false,"docs":[" Add the accounts in the list of winners for a given era"," accounts contains the list of winners and the rewards by account"],"label":"Psp22Reward::fund_rewards_and_add_winners","mutates":true,"payable":true,"returnType":{"displayName":["ink","MessageResult"],"type":17},"selector":"0xc218e5ba"},{"args":[],"default":false,"docs":[" return true if the current account has pending rewards"],"label":"Psp22Reward::has_pending_rewards","mutates":false,"payable":false,"returnType":{"displayName":["ink","MessageResult"],"type":19},"selector":"0x4fa2ad68"},{"args":[{"label":"from","type":{"displayName":["psp22reward_external","GetPendingRewardsFromInput1"],"type":16}}],"default":false,"docs":[" return the pending rewards for a given account."],"label":"Psp22Reward::get_pending_rewards_from","mutates":true,"payable":false,"returnType":{"displayName":["ink","MessageResult"],"type":21},"selector":"0xf53a4041"},{"args":[],"default":false,"docs":[" claim all pending rewards for the current account"," After claiming, there is not anymore pending rewards for this account"],"label":"Psp22Reward::claim","mutates":true,"payable":false,"returnType":{"displayName":["ink","MessageResult"],"type":17},"selector":"0x51be5832"},{"args":[{"label":"from","type":{"displayName":["psp22reward_external","ClaimFromInput1"],"type":16}}],"default":false,"docs":[" claim all pending rewards for the given account"," After claiming, there is not anymore pending rewards for this account"],"label":"Psp22Reward::claim_from","mutates":true,"payable":false,"returnType":{"displayName":["ink","MessageResult"],"type":17},"selector":"0x14e8fe0f"},{"args":[{"label":"role","type":{"displayName":["accesscontrol_external","RenounceRoleInput1"],"type":1}},{"label":"account","type":{"displayName":["accesscontrol_external","RenounceRoleInput2"],"type":24}}],"default":false,"docs":[],"label":"AccessControl::renounce_role","mutates":true,"payable":false,"returnType":{"displayName":["ink","MessageResult"],"type":25},"selector":"0xeaf1248a"},{"args":[{"label":"role","type":{"displayName":["accesscontrol_external","GrantRoleInput1"],"type":1}},{"label":"account","type":{"displayName":["accesscontrol_external","GrantRoleInput2"],"type":24}}],"default":false,"docs":[],"label":"AccessControl::grant_role","mutates":true,"payable":false,"returnType":{"displayName":["ink","MessageResult"],"type":25},"selector":"0x4ac062fd"},{"args":[{"label":"role","type":{"displayName":["accesscontrol_external","RevokeRoleInput1"],"type":1}},{"label":"account","type":{"displayName":["accesscontrol_external","RevokeRoleInput2"],"type":24}}],"default":false,"docs":[],"label":"AccessControl::revoke_role","mutates":true,"payable":false,"returnType":{"displayName":["ink","MessageResult"],"type":25},"selector":"0x6e4f0991"},{"args":[{"label":"role","type":{"displayName":["accesscontrol_external","GetRoleAdminInput1"],"type":1}}],"default":false,"docs":[],"label":"AccessControl::get_role_admin","mutates":false,"payable":false,"returnType":{"displayName":["ink","MessageResult"],"type":13},"selector":"0x83da3bb2"},{"args":[{"label":"role","type":{"displayName":["accesscontrol_external","HasRoleInput1"],"type":1}},{"label":"address","type":{"displayName":["accesscontrol_external","HasRoleInput2"],"type":24}}],"default":false,"docs":[],"label":"AccessControl::has_role","mutates":false,"payable":false,"returnType":{"displayName":["ink","MessageResult"],"type":19},"selector":"0xc1d9ac18"}]},"storage":{"root":{"layout":{"struct":{"fields":[{"layout":{"struct":{"fields":[{"layout":{"root":{"layout":{"leaf":{"key":"0x06fea0cc","ty":0}},"root_key":"0x06fea0cc"}},"name":"pending_rewards"}],"name":"Data"}},"name":"reward"},{"layout":{"struct":{"fields":[{"layout":{"root":{"layout":{"leaf":{"key":"0x1f2cf4ac","ty":1}},"root_key":"0x1f2cf4ac"}},"name":"admin_roles"},{"layout":{"root":{"layout":{"leaf":{"key":"0x8150f558","ty":2}},"root_key":"0x8150f558"}},"name":"members"}],"name":"Data"}},"name":"access"}],"name":"Contract"}},"root_key":"0x00000000"}},"types":[{"id":0,"type":{"def":{"primitive":"u128"}}},{"id":1,"type":{"def":{"primitive":"u32"}}},{"id":2,"type":{"def":{"tuple":[]}}},{"id":3,"type":{"def":{"variant":{"variants":[{"fields":[{"type":2}],"index":0,"name":"Ok"},{"fields":[{"type":4}],"index":1,"name":"Err"}]}},"params":[{"name":"T","type":2},{"name":"E","type":4}],"path":["Result"]}},{"id":4,"type":{"def":{"variant":{"variants":[{"index":1,"name":"CouldNotReadInput"}]}},"path":["ink_primitives","LangError"]}},{"id":5,"type":{"def":{"composite":{"fields":[{"type":6,"typeName":"[u8; 32]"}]}},"path":["ink_primitives","types","Hash"]}},{"id":6,"type":{"def":{"array":{"len":32,"type":7}}}},{"id":7,"type":{"def":{"primitive":"u8"}}},{"id":8,"type":{"def":{"variant":{"variants":[{"fields":[{"type":9}],"index":0,"name":"Ok"},{"fields":[{"type":4}],"index":1,"name":"Err"}]}},"params":[{"name":"T","type":9},{"name":"E","type":4}],"path":["Result"]}},{"id":9,"type":{"def":{"variant":{"variants":[{"fields":[{"type":2}],"index":0,"name":"Ok"},{"fields":[{"type":10}],"index":1,"name":"Err"}]}},"params":[{"name":"T","type":2},{"name":"E","type":10}],"path":["Result"]}},{"id":10,"type":{"def":{"variant":{"variants":[{"fields":[{"type":11,"typeName":"RewardError"}],"index":0,"name":"RewardError"},{"fields":[{"type":12,"typeName":"AccessControlError"}],"index":1,"name":"AccessControlError"},{"index":2,"name":"UpgradeError"},{"index":3,"name":"TransferError"}]}},"path":["reward_manager","reward_manager","ContractError"]}},{"id":11,"type":{"def":{"variant":{"variants":[{"index":0,"name":"InsufficientTransferredBalance"},{"index":1,"name":"TransferError"},{"index":2,"name":"AddOverFlow"},{"index":3,"name":"NoReward"},{"fields":[{"type":12,"typeName":"AccessControlError"}],"index":4,"name":"AccessControlError"}]}},"path":["lucky","traits","reward","psp22_reward","RewardError"]}},{"id":12,"type":{"def":{"variant":{"variants":[{"index":0,"name":"InvalidCaller"},{"index":1,"name":"MissingRole"},{"index":2,"name":"RoleRedundant"}]}},"path":["openbrush_contracts","traits","errors","access_control","AccessControlError"]}},{"id":13,"type":{"def":{"variant":{"variants":[{"fields":[{"type":1}],"index":0,"name":"Ok"},{"fields":[{"type":4}],"index":1,"name":"Err"}]}},"params":[{"name":"T","type":1},{"name":"E","type":4}],"path":["Result"]}},{"id":14,"type":{"def":{"sequence":{"type":15}}}},{"id":15,"type":{"def":{"tuple":[16,0]}}},{"id":16,"type":{"def":{"composite":{"fields":[{"type":6,"typeName":"[u8; 32]"}]}},"path":["ink_primitives","types","AccountId"]}},{"id":17,"type":{"def":{"variant":{"variants":[{"fields":[{"type":18}],"index":0,"name":"Ok"},{"fields":[{"type":4}],"index":1,"name":"Err"}]}},"params":[{"name":"T","type":18},{"name":"E","type":4}],"path":["Result"]}},{"id":18,"type":{"def":{"variant":{"variants":[{"fields":[{"type":2}],"index":0,"name":"Ok"},{"fields":[{"type":11}],"index":1,"name":"Err"}]}},"params":[{"name":"T","type":2},{"name":"E","type":11}],"path":["Result"]}},{"id":19,"type":{"def":{"variant":{"variants":[{"fields":[{"type":20}],"index":0,"name":"Ok"},{"fields":[{"type":4}],"index":1,"name":"Err"}]}},"params":[{"name":"T","type":20},{"name":"E","type":4}],"path":["Result"]}},{"id":20,"type":{"def":{"primitive":"bool"}}},{"id":21,"type":{"def":{"variant":{"variants":[{"fields":[{"type":22}],"index":0,"name":"Ok"},{"fields":[{"type":4}],"index":1,"name":"Err"}]}},"params":[{"name":"T","type":22},{"name":"E","type":4}],"path":["Result"]}},{"id":22,"type":{"def":{"variant":{"variants":[{"fields":[{"type":23}],"index":0,"name":"Ok"},{"fields":[{"type":11}],"index":1,"name":"Err"}]}},"params":[{"name":"T","type":23},{"name":"E","type":11}],"path":["Result"]}},{"id":23,"type":{"def":{"variant":{"variants":[{"index":0,"name":"None"},{"fields":[{"type":0}],"index":1,"name":"Some"}]}},"params":[{"name":"T","type":0}],"path":["Option"]}},{"id":24,"type":{"def":{"variant":{"variants":[{"index":0,"name":"None"},{"fields":[{"type":16}],"index":1,"name":"Some"}]}},"params":[{"name":"T","type":16}],"path":["Option"]}},{"id":25,"type":{"def":{"variant":{"variants":[{"fields":[{"type":26}],"index":0,"name":"Ok"},{"fields":[{"type":4}],"index":1,"name":"Err"}]}},"params":[{"name":"T","type":26},{"name":"E","type":4}],"path":["Result"]}},{"id":26,"type":{"def":{"variant":{"variants":[{"fields":[{"type":2}],"index":0,"name":"Ok"},{"fields":[{"type":12}],"index":1,"name":"Err"}]}},"params":[{"name":"T","type":2},{"name":"E","type":12}],"path":["Result"]}},{"id":27,"type":{"def":{"primitive":"u64"}}},{"id":28,"type":{"def":{"variant":{}},"path":["ink_env","types","NoChainExtension"]}}],"version":"4"} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "lucky" | ||
version = "0.1.0" | ||
version = "1.1.0" | ||
authors = ["guigou"] | ||
edition = "2021" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters