From f0ad83d57abfcebf8ebc7b239364be807b3ad3e1 Mon Sep 17 00:00:00 2001 From: alexx855 Date: Mon, 15 Apr 2024 03:07:20 +0000 Subject: [PATCH] Weekly update --- .../axie_consumable_consumer_logic.ts | 468 ++++++++++++++++++ src/contracts/guardian_pending_array.ts | 444 +++++++++++++++++ ...reward_distributor_proxy_for_axie_quest.ts | 155 ++++++ .../reward_distributor_proxy_for_origins.ts | 155 ++++++ src/index.ts | 4 + 5 files changed, 1226 insertions(+) create mode 100644 src/contracts/axie_consumable_consumer_logic.ts create mode 100644 src/contracts/guardian_pending_array.ts create mode 100644 src/contracts/reward_distributor_proxy_for_axie_quest.ts create mode 100644 src/contracts/reward_distributor_proxy_for_origins.ts diff --git a/src/contracts/axie_consumable_consumer_logic.ts b/src/contracts/axie_consumable_consumer_logic.ts new file mode 100644 index 0000000..c136ad2 --- /dev/null +++ b/src/contracts/axie_consumable_consumer_logic.ts @@ -0,0 +1,468 @@ +import { Contract } from '@/contract' +const abi = [ + { + inputs: [], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + inputs: [], + name: 'ErrInvalidCocoId', + type: 'error', + }, + { + inputs: [], + name: 'ErrUnauthorizedSender', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'contract IAxie', + name: 'axieContract', + type: 'address', + }, + ], + name: 'AxieContractUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'contract IAxieConsumableERC1155', + name: 'consumableContract', + type: 'address', + }, + ], + name: 'ConsumableContractUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'axieId', + type: 'uint256', + }, + { + indexed: true, + internalType: 'address', + name: 'user', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amountConsumed', + type: 'uint256', + }, + ], + name: 'Consumed', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint8', + name: 'version', + type: 'uint8', + }, + ], + name: 'Initialized', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'Paused', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'bytes32', + name: 'previousAdminRole', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'bytes32', + name: 'newAdminRole', + type: 'bytes32', + }, + ], + name: 'RoleAdminChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + ], + name: 'RoleGranted', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + ], + name: 'RoleRevoked', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'Unpaused', + type: 'event', + }, + { + inputs: [], + name: 'DEFAULT_ADMIN_ROLE', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'axieId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'consumableId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'consume', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + ], + name: 'getRoleAdmin', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + ], + name: 'getRoleMember', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + ], + name: 'getRoleMemberCount', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'grantRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'hasRole', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'admin', + type: 'address', + }, + { + internalType: 'contract IAxieConsumableERC1155', + name: 'consumableContract', + type: 'address', + }, + { + internalType: 'contract IAxie', + name: 'axieContract', + type: 'address', + }, + ], + name: 'initialize', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'pause', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'paused', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'renounceRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'role', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'revokeRole', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'contract IAxie', + name: 'axieContract', + type: 'address', + }, + ], + name: 'setAxieContract', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'contract IAxieConsumableERC1155', + name: 'consumableContract', + type: 'address', + }, + ], + name: 'setConsumableContract', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: 'interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'unpause', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, +] as const +const AXIE_CONSUMABLE_CONSUMER_LOGIC: Contract = { + name: 'AxieConsumableConsumerLogic', + address: '0x51e4438cf5b943db417c44b3b64855ad43b3a41a', + is_deprecated: false, + updated_at: 1712739178, + abi: abi, +} +export default AXIE_CONSUMABLE_CONSUMER_LOGIC diff --git a/src/contracts/guardian_pending_array.ts b/src/contracts/guardian_pending_array.ts new file mode 100644 index 0000000..df5f4bf --- /dev/null +++ b/src/contracts/guardian_pending_array.ts @@ -0,0 +1,444 @@ +import { Contract } from '@/contract' +const abi = [ + { + inputs: [ + { + internalType: 'address', + name: '_lockable', + type: 'address', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'guardian', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'GuardianRenounce', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'guardian', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'GuardianSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'pendingGuardian', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'user', + type: 'address', + }, + ], + name: 'PendingGuardianSet', + type: 'event', + }, + { + inputs: [], + name: 'LOCKABLE', + outputs: [ + { + internalType: 'contract ILockERC721', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_protege', + type: 'address', + }, + ], + name: 'acceptGuardianship', + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + ], + name: 'getLockedAssetsOfUsers', + outputs: [ + { + internalType: 'uint256[]', + name: 'lockedAssets', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_user', + type: 'address', + }, + { + internalType: 'uint256', + name: '_startIndex', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '_maxLen', + type: 'uint256', + }, + ], + name: 'getLockedAssetsOfUsers', + outputs: [ + { + internalType: 'uint256[]', + name: 'lockedAssets', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_guardian', + type: 'address', + }, + ], + name: 'getPendingProteges', + outputs: [ + { + internalType: 'address[]', + name: '_proteges', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_guardian', + type: 'address', + }, + ], + name: 'getProtegesFromGuardian', + outputs: [ + { + internalType: 'address[]', + name: 'proteges', + type: 'address[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'guardianToUserIndex', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + name: 'guardianToUsers', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'guardianUserCount', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'guardians', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256[]', + name: '_tokenIds', + type: 'uint256[]', + }, + ], + name: 'lockMany', + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + name: 'pendingGuardianArray', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'pendingGuardianUserCount', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'pendingGuardians', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_guardian', + type: 'address', + }, + ], + name: 'proposeGuardian', + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_protege', + type: 'address', + }, + ], + name: 'renounce', + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_protege', + type: 'address', + }, + { + internalType: 'uint256[]', + name: '_tokenIds', + type: 'uint256[]', + }, + { + internalType: 'address', + name: '_recipient', + type: 'address', + }, + ], + name: 'renounceAndTransfer', + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256[]', + name: '_tokenIds', + type: 'uint256[]', + }, + ], + name: 'unlockMany', + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256[]', + name: '_tokenIds', + type: 'uint256[]', + }, + { + internalType: 'address', + name: '_recipient', + type: 'address', + }, + ], + name: 'unlockManyAndTransfer', + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'userData', + outputs: [ + { + internalType: 'address', + name: 'guardian', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, +] as const +const GUARDIAN_PENDING_ARRAY: Contract = { + name: 'Guardian Pending Array', + address: '0x64f58013256075ae41ac7c0a8936b7e758892a47', + is_deprecated: false, + updated_at: 1713150327, + abi: abi, +} +export default GUARDIAN_PENDING_ARRAY diff --git a/src/contracts/reward_distributor_proxy_for_axie_quest.ts b/src/contracts/reward_distributor_proxy_for_axie_quest.ts new file mode 100644 index 0000000..fe0f899 --- /dev/null +++ b/src/contracts/reward_distributor_proxy_for_axie_quest.ts @@ -0,0 +1,155 @@ +import { Contract } from '@/contract' +const abi = [ + { + inputs: [ + { + internalType: 'address', + name: '_logic', + type: 'address', + }, + { + internalType: 'address', + name: 'admin_', + type: 'address', + }, + { + internalType: 'bytes', + name: '_data', + type: 'bytes', + }, + ], + stateMutability: 'payable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'previousAdmin', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'newAdmin', + type: 'address', + }, + ], + name: 'AdminChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'beacon', + type: 'address', + }, + ], + name: 'BeaconUpgraded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'implementation', + type: 'address', + }, + ], + name: 'Upgraded', + type: 'event', + }, + { + stateMutability: 'payable', + type: 'fallback', + }, + { + inputs: [], + name: 'admin', + outputs: [ + { + internalType: 'address', + name: 'admin_', + type: 'address', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newAdmin', + type: 'address', + }, + ], + name: 'changeAdmin', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'implementation', + outputs: [ + { + internalType: 'address', + name: 'implementation_', + type: 'address', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newImplementation', + type: 'address', + }, + ], + name: 'upgradeTo', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newImplementation', + type: 'address', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'upgradeToAndCall', + outputs: [], + stateMutability: 'payable', + type: 'function', + }, + { + stateMutability: 'payable', + type: 'receive', + }, +] as const +const REWARD_DISTRIBUTOR_PROXY_FOR_AXIE_QUEST: Contract = { + name: 'Reward Distributor Proxy For Axie Quest', + address: '0x21d18ae443f86a755ba47d6241c49c5bcf070bbf', + is_deprecated: false, + updated_at: 1713150124, + abi: abi, +} +export default REWARD_DISTRIBUTOR_PROXY_FOR_AXIE_QUEST diff --git a/src/contracts/reward_distributor_proxy_for_origins.ts b/src/contracts/reward_distributor_proxy_for_origins.ts new file mode 100644 index 0000000..bb0f20b --- /dev/null +++ b/src/contracts/reward_distributor_proxy_for_origins.ts @@ -0,0 +1,155 @@ +import { Contract } from '@/contract' +const abi = [ + { + inputs: [ + { + internalType: 'address', + name: '_logic', + type: 'address', + }, + { + internalType: 'address', + name: 'admin_', + type: 'address', + }, + { + internalType: 'bytes', + name: '_data', + type: 'bytes', + }, + ], + stateMutability: 'payable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'previousAdmin', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'newAdmin', + type: 'address', + }, + ], + name: 'AdminChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'beacon', + type: 'address', + }, + ], + name: 'BeaconUpgraded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'implementation', + type: 'address', + }, + ], + name: 'Upgraded', + type: 'event', + }, + { + stateMutability: 'payable', + type: 'fallback', + }, + { + inputs: [], + name: 'admin', + outputs: [ + { + internalType: 'address', + name: 'admin_', + type: 'address', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newAdmin', + type: 'address', + }, + ], + name: 'changeAdmin', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'implementation', + outputs: [ + { + internalType: 'address', + name: 'implementation_', + type: 'address', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newImplementation', + type: 'address', + }, + ], + name: 'upgradeTo', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newImplementation', + type: 'address', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'upgradeToAndCall', + outputs: [], + stateMutability: 'payable', + type: 'function', + }, + { + stateMutability: 'payable', + type: 'receive', + }, +] as const +const REWARD_DISTRIBUTOR_PROXY_FOR_ORIGINS: Contract = { + name: 'Reward Distributor Proxy For Origins', + address: '0xd609ecedbd02858dda812621a27b68c52732cc01', + is_deprecated: false, + updated_at: 1713150128, + abi: abi, +} +export default REWARD_DISTRIBUTOR_PROXY_FOR_ORIGINS diff --git a/src/index.ts b/src/index.ts index 0697ede..5f3f689 100644 --- a/src/index.ts +++ b/src/index.ts @@ -32,6 +32,7 @@ export { default as AXIE_ACCESSORY_COLLECTION } from '@/contracts/axie_accessory export { default as AXIE_ASCEND_PROXY } from '@/contracts/axie_ascend_proxy' export { default as AXIE_BADGE_PROXY } from '@/contracts/axie_badge_proxy' export { default as AXIE_CHAT_PREMIUM_2023 } from '@/contracts/axie_chat_premium_2023' +export { default as AXIE_CONSUMABLE_CONSUMER_LOGIC } from '@/contracts/axie_consumable_consumer_logic' export { default as AXIE_CONSUMABLE_CONSUMER_PROXY } from '@/contracts/axie_consumable_consumer_proxy' export { default as AXIE_CONSUMABLE_ERC1155_PROXY } from '@/contracts/axie_consumable_erc1155_proxy' export { default as AXIE_EGG_COIN } from '@/contracts/axie_egg_coin' @@ -120,6 +121,7 @@ export { default as GNOSIS_SAFE_L2 } from '@/contracts/gnosis_safe_l2' export { default as GNOSIS_SAFE_PROXY } from '@/contracts/gnosis_safe_proxy' export { default as GNOSIS_SAFE_PROXY_FACTORY } from '@/contracts/gnosis_safe_proxy_factory' export { default as GOVERNANCE_ADMIN } from '@/contracts/governance_admin' +export { default as GUARDIAN_PENDING_ARRAY } from '@/contracts/guardian_pending_array' export { default as GUILD_MEMBERSHIPS } from '@/contracts/guild_memberships' export { default as IAP } from '@/contracts/iap' export { default as JOURNAL } from '@/contracts/journal' @@ -214,6 +216,8 @@ export { default as RESTRICTION_CONTROL } from '@/contracts/restriction_control' export { default as REWARD_DISPENSER_PROXY } from '@/contracts/reward_dispenser_proxy' export { default as REWARD_DISTRIBUTOR } from '@/contracts/reward_distributor' export { default as REWARD_DISTRIBUTOR_PROXY } from '@/contracts/reward_distributor_proxy' +export { default as REWARD_DISTRIBUTOR_PROXY_FOR_AXIE_QUEST } from '@/contracts/reward_distributor_proxy_for_axie_quest' +export { default as REWARD_DISTRIBUTOR_PROXY_FOR_ORIGINS } from '@/contracts/reward_distributor_proxy_for_origins' export { default as REWARD_SPLITTER } from '@/contracts/reward_splitter' export { default as REWARDS } from '@/contracts/rewards' export { default as RNS_AUCTION } from '@/contracts/rns_auction'