From e6aefbf2f69b3565fd9c0f870e4da2c0d3cae76f Mon Sep 17 00:00:00 2001 From: Blasco Date: Sun, 21 Apr 2024 12:11:08 +0100 Subject: [PATCH 1/4] feat: add staker power Signed-off-by: Blasco --- src/adapters/superverse-staking.adapter.ts | 33 ++++++++++++++++++++++ src/component.ts | 5 ++-- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/src/adapters/superverse-staking.adapter.ts b/src/adapters/superverse-staking.adapter.ts index 4dffaf8..8f7ac11 100644 --- a/src/adapters/superverse-staking.adapter.ts +++ b/src/adapters/superverse-staking.adapter.ts @@ -12,6 +12,8 @@ import {SuperverseStaking__factory} from '../types/factories/SuperverseStaking__ // Mark it as an extension to staking contracts service extensionFor(STAKING_ADAPTERS_EXTENSION_POINT), ) + + export class SuperverseStakingContractAdapter extends BaseStakingContractAdapter { /** * The contract address @@ -42,3 +44,34 @@ export class SuperverseStakingContractAdapter extends BaseStakingContractAdapter return stakerInfo.stakedTokens; } } + +export class SuperverseStakingPowerContractAdapter extends BaseStakingContractAdapter { + /** + * The contract address + */ + contractAddress = '0x8C96EdC82d111E3c5686F5ABE738A82d54d0b887'; + + /** + * Assets that can be staked to this contract: SuperVerse ERC20 + */ + supportedAssets: StakingAsset[] = [ + { + asset: 'ERC20:0xe53EC727dbDEB9E2d5456c3be40cFF031AB40A55', + }, + ]; + + /** + * Get staked token ids for the given owner + * @param owner - Owner address + * @returns + */ + async getStakedTokenBalance(owner: string): Promise { + const contract = SuperverseStaking__factory.connect( + this.contractAddress, + this.provider, + ); + + const stakerInfo = await contract.stakerInfo(owner); + return stakerInfo.stakerPower; + } +} diff --git a/src/component.ts b/src/component.ts index 5b128af..5b3b4eb 100644 --- a/src/component.ts +++ b/src/component.ts @@ -68,9 +68,9 @@ import {TtooStakingContractAdapter} from './adapters/ttoo-staking.adapter.js'; import {UwULendStakingContractAdapter} from './adapters/uwulend-staking.adapter.js'; import {WarriorsofankhStakingContractAdapter} from './adapters/warriorsofankh-staking.adapter.js'; import {XenoStakingContractAdapter} from './adapters/xeno-mining.adapter.js'; -import {STAKING_CONTRACTS_COMPONENT} from './keys.js'; import {StakingContractsService} from './services/staking-contracts.service.js'; -import {SuperverseStakingContractAdapter} from './adapters/superverse-staking.adapter.js'; +import {SuperverseStakingContractAdapter, SuperverseStakingPowerContractAdapter} from './adapters/superverse-staking.adapter.js'; +import {STAKING_CONTRACTS_COMPONENT} from './keys.js'; // Configure the binding for StakingContractsComponent @injectable({ @@ -132,6 +132,7 @@ export class StakingContractsComponent implements Component { DwebUniV2EthereumStakingContractAdapter, DwebUniV2PolygonStakingContractAdapter, SuperverseStakingContractAdapter, + SuperverseStakingPowerContractAdapter, ]; constructor() {} } From 14f3b8af2d782c02b668d4524097d7ad1d189214 Mon Sep 17 00:00:00 2001 From: Blasco Date: Thu, 25 Apr 2024 22:31:45 +0100 Subject: [PATCH 2/4] fix: start nft contract implementation Signed-off-by: Blasco --- src/adapters/start.adapter.ts | 4 ++-- src/contracts/{START.json => start-nft.json} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename src/contracts/{START.json => start-nft.json} (100%) diff --git a/src/adapters/start.adapter.ts b/src/adapters/start.adapter.ts index a9b214c..75dea41 100644 --- a/src/adapters/start.adapter.ts +++ b/src/adapters/start.adapter.ts @@ -3,7 +3,7 @@ import {BigNumber} from 'ethers'; import {STAKING_ADAPTERS_EXTENSION_POINT} from '../keys.js'; import {BaseStakingContractAdapter, StakingAsset} from '../staking.js'; // Use the full path to import instead of `../types` -import {Start__factory} from '../types/factories/Start__factory.js'; +import {StartNft__factory} from '../types/factories/StartNft__factory.js'; @injectable( { @@ -33,7 +33,7 @@ export class StartStakingContractAdapter extends BaseStakingContractAdapter { * @returns */ getStakedTokenIds(owner: string): Promise { - const contract = Start__factory.connect( + const contract = StartNft__factory.connect( this.contractAddress, this.provider, ); diff --git a/src/contracts/START.json b/src/contracts/start-nft.json similarity index 100% rename from src/contracts/START.json rename to src/contracts/start-nft.json From 2a44cf92defabeb56810a38b00e780bfeecb227d Mon Sep 17 00:00:00 2001 From: Blasco Date: Mon, 29 Apr 2024 08:14:39 +0100 Subject: [PATCH 3/4] fix: use only stakerPower Signed-off-by: Blasco --- src/adapters/superverse-staking.adapter.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/adapters/superverse-staking.adapter.ts b/src/adapters/superverse-staking.adapter.ts index d838e66..15e837a 100644 --- a/src/adapters/superverse-staking.adapter.ts +++ b/src/adapters/superverse-staking.adapter.ts @@ -25,11 +25,7 @@ export class SuperverseStakingContractAdapter extends BaseStakingContractAdapter { name: 'SuperVerse', asset: 'ERC20:0xe53EC727dbDEB9E2d5456c3be40cFF031AB40A55', - }, - { - name: 'SuperVersePower', - asset: 'ERC20:0xe53EC727dbDEB9E2d5456c3be40cFF031AB40A55', - }, + } ]; /** @@ -39,17 +35,13 @@ export class SuperverseStakingContractAdapter extends BaseStakingContractAdapter */ async getStakedTokenBalance( owner: string, - name = 'SuperVerse', ): Promise { - name = name.toLowerCase(); const contract = SuperverseStaking__factory.connect( this.contractAddress, this.provider, ); const stakerInfo = await contract.stakerInfo(owner); - return name === 'superverse' - ? stakerInfo.stakedTokens - : stakerInfo.stakerPower; + return stakerInfo.stakerPower } } From c61de7e1df51d39284969c15dda1d2b11c64c999 Mon Sep 17 00:00:00 2001 From: Blasco Date: Mon, 24 Jun 2024 02:51:21 +0100 Subject: [PATCH 4/4] feat: add xai staking contract Signed-off-by: Blasco --- src/adapters/superverse-staking.adapter.ts | 8 +- src/adapters/xai-staking.adapter.ts | 66 ++ src/component.ts | 2 + src/contracts/xai-pool-factory.json | 890 +++++++++++++++++++++ src/contracts/xai-staking-pool.json | 671 ++++++++++++++++ 5 files changed, 1632 insertions(+), 5 deletions(-) create mode 100644 src/adapters/xai-staking.adapter.ts create mode 100644 src/contracts/xai-pool-factory.json create mode 100644 src/contracts/xai-staking-pool.json diff --git a/src/adapters/superverse-staking.adapter.ts b/src/adapters/superverse-staking.adapter.ts index 15e837a..a6e2df4 100644 --- a/src/adapters/superverse-staking.adapter.ts +++ b/src/adapters/superverse-staking.adapter.ts @@ -25,7 +25,7 @@ export class SuperverseStakingContractAdapter extends BaseStakingContractAdapter { name: 'SuperVerse', asset: 'ERC20:0xe53EC727dbDEB9E2d5456c3be40cFF031AB40A55', - } + }, ]; /** @@ -33,15 +33,13 @@ export class SuperverseStakingContractAdapter extends BaseStakingContractAdapter * @param owner - Owner address * @returns */ - async getStakedTokenBalance( - owner: string, - ): Promise { + async getStakedTokenBalance(owner: string): Promise { const contract = SuperverseStaking__factory.connect( this.contractAddress, this.provider, ); const stakerInfo = await contract.stakerInfo(owner); - return stakerInfo.stakerPower + return stakerInfo.stakerPower; } } diff --git a/src/adapters/xai-staking.adapter.ts b/src/adapters/xai-staking.adapter.ts new file mode 100644 index 0000000..8409fcf --- /dev/null +++ b/src/adapters/xai-staking.adapter.ts @@ -0,0 +1,66 @@ +import {BindingScope, extensionFor, injectable} from '@loopback/core'; +import {BigNumber} from 'ethers'; +import {STAKING_ADAPTERS_EXTENSION_POINT} from '../keys.js'; +import {BaseStakingContractAdapter, StakingAsset} from '../staking.js'; + +import {XaiPoolFactory__factory} from '../types/factories/XaiPoolFactory__factory.js'; +import {XaiStakingPool__factory} from '../types/factories/XaiStakingPool__factory.js'; + +@injectable( + { + scope: BindingScope.SINGLETON, // Mark the adapter as a singleton + }, + // Mark it as an extension to staking contracts service + extensionFor(STAKING_ADAPTERS_EXTENSION_POINT), +) +export class XaiStakingContractAdapter extends BaseStakingContractAdapter { + /** + * The contract address + */ + contractAddress = '0xF9E08660223E2dbb1c0b28c82942aB6B5E38b8E5'; + + /** + * Assets that can be staked to this contract: SuperVerse ERC20 + */ + supportedAssets: StakingAsset[] = [ + { + name: 'EsXai', + asset: 'ERC20:0x4C749d097832DE2FEcc989ce18fDc5f1BD76700c', + }, + ]; + + /** + * Chain id for the staking contract, default to `1` (Ethereum Mainnet) + */ + chainId = 42161; + + /** + * Get staked token ids for the given owner + * @param owner - Owner address + * @returns + */ + async getStakedTokenBalance(owner: string): Promise { + const poolFactoryContract = XaiPoolFactory__factory.connect( + this.contractAddress, + this.provider, + ); + const poolAddresses = await poolFactoryContract.getPoolIndicesOfUser(owner); + + if (poolAddresses.length === 0) { + return BigNumber.from('0'); + } + + let accumulatedBalance = BigNumber.from('0'); + + for (const poolAddress of poolAddresses) { + const stakingPoolContract = XaiStakingPool__factory.connect( + poolAddress, + this.provider, + ); + const stakerInfo = await stakingPoolContract.getStakedAmounts(owner); + accumulatedBalance = accumulatedBalance.add(stakerInfo); + } + + return accumulatedBalance; + } +} diff --git a/src/component.ts b/src/component.ts index 61976fb..bb6ec17 100644 --- a/src/component.ts +++ b/src/component.ts @@ -75,6 +75,7 @@ import {SupremeKongStakingContractAdapter} from './adapters/supreme-kong-staking import {TtooStakingContractAdapter} from './adapters/ttoo-staking.adapter.js'; import {UwULendStakingContractAdapter} from './adapters/uwulend-staking.adapter.js'; import {WarriorsofankhStakingContractAdapter} from './adapters/warriorsofankh-staking.adapter.js'; +import {XaiStakingContractAdapter} from './adapters/xai-staking.adapter.js'; import {XenoStakingContractAdapter} from './adapters/xeno-mining.adapter.js'; import {STAKING_CONTRACTS_COMPONENT} from './keys.js'; import {StakingContractsService} from './services/staking-contracts.service.js'; @@ -144,6 +145,7 @@ export class StakingContractsComponent implements Component { RailgunBinanceGovernanceAdapter, RailgunEthereumGovernanceAdapter, RailgunPolygonGovernanceAdapter, + XaiStakingContractAdapter, ]; constructor() {} } diff --git a/src/contracts/xai-pool-factory.json b/src/contracts/xai-pool-factory.json new file mode 100644 index 0000000..17e25c0 --- /dev/null +++ b/src/contracts/xai-pool-factory.json @@ -0,0 +1,890 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "pool", + "type": "address" + } + ], + "name": "ClaimFromPool", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "poolIndex", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "poolAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "poolOwner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "stakedKeyCount", + "type": "uint256" + } + ], + "name": "PoolCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldDeployer", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newDeployer", + "type": "address" + } + ], + "name": "PoolProxyDeployerUpdated", + "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": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "pool", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalUserEsXaiStaked", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalEsXaiStaked", + "type": "uint256" + } + ], + "name": "StakeEsXai", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "pool", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalUserKeysStaked", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalKeysStaked", + "type": "uint256" + } + ], + "name": "StakeKeys", + "type": "event" + }, + {"anonymous": false, "inputs": [], "name": "StakingEnabled", "type": "event"}, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "pool", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalUserEsXaiStaked", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalEsXaiStaked", + "type": "uint256" + } + ], + "name": "UnstakeEsXai", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "pool", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalUserKeysStaked", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "totalKeysStaked", + "type": "uint256" + } + ], + "name": "UnstakeKeys", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "pool", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "index", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "isKey", + "type": "bool" + } + ], + "name": "UnstakeRequestStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "UpdateDelayPeriods", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "pool", + "type": "address" + } + ], + "name": "UpdateMetadata", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "pool", + "type": "address" + } + ], + "name": "UpdatePoolDelegate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "pool", + "type": "address" + } + ], + "name": "UpdateShares", + "type": "event" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [{"internalType": "bytes32", "name": "", "type": "bytes32"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], + "name": "bucketshareMaxValues", + "outputs": [{"internalType": "uint32", "name": "", "type": "uint32"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + {"internalType": "uint256[]", "name": "keyIds", "type": "uint256[]"} + ], + "name": "checkKeysAreStaked", + "outputs": [ + {"internalType": "bool[]", "name": "isStaked", "type": "bool[]"} + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + {"internalType": "address[]", "name": "pools", "type": "address[]"} + ], + "name": "claimFromPools", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + {"internalType": "address", "name": "_delegateOwner", "type": "address"}, + {"internalType": "uint256[]", "name": "_keyIds", "type": "uint256[]"}, + { + "internalType": "uint32[3]", + "name": "_shareConfig", + "type": "uint32[3]" + }, + { + "internalType": "string[3]", + "name": "_poolMetadata", + "type": "string[3]" + }, + {"internalType": "string[]", "name": "_poolSocials", "type": "string[]"}, + { + "internalType": "string[2][2]", + "name": "trackerDetails", + "type": "string[2][2]" + } + ], + "name": "createPool", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + {"internalType": "address", "name": "pool", "type": "address"}, + {"internalType": "uint256", "name": "amount", "type": "uint256"} + ], + "name": "createUnstakeEsXaiRequest", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + {"internalType": "address", "name": "pool", "type": "address"}, + {"internalType": "uint256", "name": "keyAmount", "type": "uint256"} + ], + "name": "createUnstakeKeyRequest", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{"internalType": "address", "name": "pool", "type": "address"}], + "name": "createUnstakeOwnerLastKeyRequest", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "deployerAddress", + "outputs": [{"internalType": "address", "name": "", "type": "address"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "enableStaking", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "esXaiAddress", + "outputs": [{"internalType": "address", "name": "", "type": "address"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + {"internalType": "address", "name": "delegate", "type": "address"} + ], + "name": "getDelegatePools", + "outputs": [{"internalType": "address[]", "name": "", "type": "address[]"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + {"internalType": "uint256", "name": "poolIndex", "type": "uint256"} + ], + "name": "getPoolAddress", + "outputs": [{"internalType": "address", "name": "", "type": "address"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + {"internalType": "address", "name": "user", "type": "address"}, + {"internalType": "uint256", "name": "index", "type": "uint256"} + ], + "name": "getPoolAddressOfUser", + "outputs": [{"internalType": "address", "name": "", "type": "address"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{"internalType": "address", "name": "user", "type": "address"}], + "name": "getPoolIndicesOfUser", + "outputs": [{"internalType": "address[]", "name": "", "type": "address[]"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPoolsCount", + "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{"internalType": "address", "name": "user", "type": "address"}], + "name": "getPoolsOfUserCount", + "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], + "stateMutability": "view", + "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": "address", "name": "user", "type": "address"}, + {"internalType": "uint16", "name": "offset", "type": "uint16"}, + {"internalType": "uint16", "name": "pageLimit", "type": "uint16"} + ], + "name": "getUnstakedKeyIdsFromUser", + "outputs": [ + { + "internalType": "uint256[]", + "name": "unstakedKeyIds", + "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": "_refereeAddress", "type": "address"}, + {"internalType": "address", "name": "_esXaiAddress", "type": "address"}, + { + "internalType": "address", + "name": "_nodeLicenseAddress", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + {"internalType": "address", "name": "", "type": "address"}, + {"internalType": "uint256", "name": "", "type": "uint256"} + ], + "name": "interactedPoolsOfUser", + "outputs": [{"internalType": "address", "name": "", "type": "address"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + {"internalType": "address", "name": "delegate", "type": "address"}, + {"internalType": "address", "name": "pool", "type": "address"} + ], + "name": "isDelegateOfPoolOrOwner", + "outputs": [{"internalType": "bool", "name": "", "type": "bool"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "nodeLicenseAddress", + "outputs": [{"internalType": "address", "name": "", "type": "address"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{"internalType": "address", "name": "", "type": "address"}], + "name": "poolsCreatedViaFactory", + "outputs": [{"internalType": "bool", "name": "", "type": "bool"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + {"internalType": "address", "name": "", "type": "address"}, + {"internalType": "uint256", "name": "", "type": "uint256"} + ], + "name": "poolsOfDelegate", + "outputs": [{"internalType": "address", "name": "", "type": "address"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{"internalType": "address", "name": "", "type": "address"}], + "name": "poolsOfDelegateIndices", + "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "refereeAddress", + "outputs": [{"internalType": "address", "name": "", "type": "address"}], + "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": "address", "name": "pool", "type": "address"}, + {"internalType": "uint256", "name": "amount", "type": "uint256"} + ], + "name": "stakeEsXai", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + {"internalType": "address", "name": "pool", "type": "address"}, + {"internalType": "uint256[]", "name": "keyIds", "type": "uint256[]"} + ], + "name": "stakeKeys", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "stakingEnabled", + "outputs": [{"internalType": "bool", "name": "", "type": "bool"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], + "name": "stakingPools", + "outputs": [{"internalType": "address", "name": "", "type": "address"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + {"internalType": "bytes4", "name": "interfaceId", "type": "bytes4"} + ], + "name": "supportsInterface", + "outputs": [{"internalType": "bool", "name": "", "type": "bool"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + {"internalType": "address", "name": "pool", "type": "address"}, + { + "internalType": "uint256", + "name": "unstakeRequestIndex", + "type": "uint256" + }, + {"internalType": "uint256", "name": "amount", "type": "uint256"} + ], + "name": "unstakeEsXai", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unstakeEsXaiDelayPeriod", + "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "unstakeGenesisKeyDelayPeriod", + "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + {"internalType": "address", "name": "pool", "type": "address"}, + { + "internalType": "uint256", + "name": "unstakeRequestIndex", + "type": "uint256" + }, + {"internalType": "uint256[]", "name": "keyIds", "type": "uint256[]"} + ], + "name": "unstakeKeys", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unstakeKeysDelayPeriod", + "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_unstakeKeysDelayPeriod", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_unstakeGenesisKeyDelayPeriod", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_unstakeEsXaiDelayPeriod", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_updateRewardBreakdownDelayPeriod", + "type": "uint256" + } + ], + "name": "updateDelayPeriods", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + {"internalType": "address", "name": "pool", "type": "address"}, + {"internalType": "address", "name": "delegate", "type": "address"} + ], + "name": "updateDelegateOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + {"internalType": "address", "name": "pool", "type": "address"}, + { + "internalType": "string[3]", + "name": "_poolMetadata", + "type": "string[3]" + }, + {"internalType": "string[]", "name": "_poolSocials", "type": "string[]"} + ], + "name": "updatePoolMetadata", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + {"internalType": "address", "name": "newDeployer", "type": "address"} + ], + "name": "updatePoolProxyDeployer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "updateRewardBreakdownDelayPeriod", + "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + {"internalType": "address", "name": "pool", "type": "address"}, + {"internalType": "uint32[3]", "name": "_shareConfig", "type": "uint32[3]"} + ], + "name": "updateShares", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + {"internalType": "address", "name": "", "type": "address"}, + {"internalType": "address", "name": "", "type": "address"} + ], + "name": "userToInteractedPoolIds", + "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], + "stateMutability": "view", + "type": "function" + } +] diff --git a/src/contracts/xai-staking-pool.json b/src/contracts/xai-staking-pool.json new file mode 100644 index 0000000..11608e3 --- /dev/null +++ b/src/contracts/xai-staking-pool.json @@ -0,0 +1,671 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "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" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [{"internalType": "bytes32", "name": "", "type": "bytes32"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "POOL_ADMIN", + "outputs": [{"internalType": "bytes32", "name": "", "type": "bytes32"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{"internalType": "address", "name": "user", "type": "address"}], + "name": "claimRewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + {"internalType": "address", "name": "user", "type": "address"}, + {"internalType": "uint256", "name": "amount", "type": "uint256"}, + {"internalType": "uint256", "name": "period", "type": "uint256"} + ], + "name": "createUnstakeEsXaiRequest", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + {"internalType": "address", "name": "user", "type": "address"}, + {"internalType": "uint256", "name": "keyAmount", "type": "uint256"}, + {"internalType": "uint256", "name": "period", "type": "uint256"} + ], + "name": "createUnstakeKeyRequest", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + {"internalType": "address", "name": "owner", "type": "address"}, + {"internalType": "uint256", "name": "period", "type": "uint256"} + ], + "name": "createUnstakeOwnerLastKeyRequest", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "delegateOwner", + "outputs": [{"internalType": "address", "name": "", "type": "address"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "description", + "outputs": [{"internalType": "string", "name": "", "type": "string"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "esXaiAddress", + "outputs": [{"internalType": "address", "name": "", "type": "address"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "esXaiStakeBucket", + "outputs": [ + {"internalType": "contract BucketTracker", "name": "", "type": "address"} + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getDelegateOwner", + "outputs": [{"internalType": "address", "name": "", "type": "address"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPoolInfo", + "outputs": [ + { + "components": [ + {"internalType": "address", "name": "poolAddress", "type": "address"}, + {"internalType": "address", "name": "owner", "type": "address"}, + { + "internalType": "address", + "name": "keyBucketTracker", + "type": "address" + }, + { + "internalType": "address", + "name": "esXaiBucketTracker", + "type": "address" + }, + {"internalType": "uint256", "name": "keyCount", "type": "uint256"}, + { + "internalType": "uint256", + "name": "totalStakedAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updateSharesTimestamp", + "type": "uint256" + }, + {"internalType": "uint32", "name": "ownerShare", "type": "uint32"}, + { + "internalType": "uint32", + "name": "keyBucketShare", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "stakedBucketShare", + "type": "uint32" + } + ], + "internalType": "struct StakingPool.PoolBaseInfo", + "name": "baseInfo", + "type": "tuple" + }, + {"internalType": "string", "name": "_name", "type": "string"}, + {"internalType": "string", "name": "_description", "type": "string"}, + {"internalType": "string", "name": "_logo", "type": "string"}, + {"internalType": "string[]", "name": "_socials", "type": "string[]"}, + { + "internalType": "uint32[]", + "name": "_pendingShares", + "type": "uint32[]" + }, + { + "internalType": "uint256", + "name": "_ownerStakedKeys", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_ownerRequestedUnstakeKeyAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_ownerLatestUnstakeRequestLockTime", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPoolOwner", + "outputs": [{"internalType": "address", "name": "", "type": "address"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{"internalType": "bytes32", "name": "role", "type": "bytes32"}], + "name": "getRoleAdmin", + "outputs": [{"internalType": "bytes32", "name": "", "type": "bytes32"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{"internalType": "address", "name": "user", "type": "address"}], + "name": "getStakedAmounts", + "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getStakedKeys", + "outputs": [{"internalType": "uint256[]", "name": "", "type": "uint256[]"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getStakedKeysCount", + "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{"internalType": "address", "name": "user", "type": "address"}], + "name": "getStakedKeysCountForUser", + "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{"internalType": "address", "name": "user", "type": "address"}], + "name": "getUndistributedClaimAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "claimAmountFromKeys", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "claimAmountFromEsXai", + "type": "uint256" + }, + {"internalType": "uint256", "name": "claimAmount", "type": "uint256"}, + {"internalType": "uint256", "name": "ownerAmount", "type": "uint256"} + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + {"internalType": "address", "name": "account", "type": "address"}, + {"internalType": "uint256", "name": "index", "type": "uint256"} + ], + "name": "getUnstakeRequest", + "outputs": [ + { + "components": [ + {"internalType": "bool", "name": "open", "type": "bool"}, + {"internalType": "bool", "name": "isKeyRequest", "type": "bool"}, + {"internalType": "uint256", "name": "amount", "type": "uint256"}, + {"internalType": "uint256", "name": "lockTime", "type": "uint256"}, + { + "internalType": "uint256", + "name": "completeTime", + "type": "uint256" + }, + {"internalType": "uint256[5]", "name": "__gap", "type": "uint256[5]"} + ], + "internalType": "struct StakingPool.UnstakeRequest", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + {"internalType": "address", "name": "account", "type": "address"} + ], + "name": "getUnstakeRequestCount", + "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{"internalType": "address", "name": "user", "type": "address"}], + "name": "getUserPoolData", + "outputs": [ + { + "internalType": "uint256", + "name": "userStakedEsXaiAmount", + "type": "uint256" + }, + {"internalType": "uint256", "name": "userClaimAmount", "type": "uint256"}, + { + "internalType": "uint256[]", + "name": "userStakedKeyIds", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "unstakeRequestkeyAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "unstakeRequestesXaiAmount", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{"internalType": "address", "name": "user", "type": "address"}], + "name": "getUserRequestedUnstakeAmounts", + "outputs": [ + {"internalType": "uint256", "name": "keyAmount", "type": "uint256"}, + {"internalType": "uint256", "name": "esXaiAmount", "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": "uint32", "name": "_ownerShare", "type": "uint32"}, + {"internalType": "uint32", "name": "_keyBucketShare", "type": "uint32"}, + {"internalType": "uint32", "name": "_stakedBucketShare", "type": "uint32"} + ], + "name": "initShares", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + {"internalType": "address", "name": "_refereeAddress", "type": "address"}, + {"internalType": "address", "name": "_esXaiAddress", "type": "address"}, + {"internalType": "address", "name": "_owner", "type": "address"}, + {"internalType": "address", "name": "_delegateOwner", "type": "address"}, + {"internalType": "address", "name": "_keyBucket", "type": "address"}, + { + "internalType": "address", + "name": "_esXaiStakeBucket", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{"internalType": "address", "name": "user", "type": "address"}], + "name": "isUserEngagedWithPool", + "outputs": [{"internalType": "bool", "name": "", "type": "bool"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "keyBucket", + "outputs": [ + {"internalType": "contract BucketTracker", "name": "", "type": "address"} + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "keyBucketShare", + "outputs": [{"internalType": "uint32", "name": "", "type": "uint32"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], + "name": "keyIdIndex", + "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "logo", + "outputs": [{"internalType": "string", "name": "", "type": "string"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [{"internalType": "string", "name": "", "type": "string"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "ownerShare", + "outputs": [{"internalType": "uint32", "name": "", "type": "uint32"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "poolOwner", + "outputs": [{"internalType": "address", "name": "", "type": "address"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "poolOwnerClaimableRewards", + "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "refereeAddress", + "outputs": [{"internalType": "address", "name": "", "type": "address"}], + "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": "uint256", "name": "", "type": "uint256"}], + "name": "socials", + "outputs": [{"internalType": "string", "name": "", "type": "string"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + {"internalType": "address", "name": "owner", "type": "address"}, + {"internalType": "uint256", "name": "amount", "type": "uint256"} + ], + "name": "stakeEsXai", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + {"internalType": "address", "name": "owner", "type": "address"}, + {"internalType": "uint256[]", "name": "keyIds", "type": "uint256[]"} + ], + "name": "stakeKeys", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{"internalType": "address", "name": "", "type": "address"}], + "name": "stakedAmounts", + "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "stakedBucketShare", + "outputs": [{"internalType": "uint32", "name": "", "type": "uint32"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], + "name": "stakedKeys", + "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], + "name": "stakedKeysIndices", + "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + {"internalType": "address", "name": "", "type": "address"}, + {"internalType": "uint256", "name": "", "type": "uint256"} + ], + "name": "stakedKeysOfOwner", + "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + {"internalType": "bytes4", "name": "interfaceId", "type": "bytes4"} + ], + "name": "supportsInterface", + "outputs": [{"internalType": "bool", "name": "", "type": "bool"}], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + {"internalType": "address", "name": "owner", "type": "address"}, + { + "internalType": "uint256", + "name": "unstakeRequestIndex", + "type": "uint256" + }, + {"internalType": "uint256", "name": "amount", "type": "uint256"} + ], + "name": "unstakeEsXai", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + {"internalType": "address", "name": "owner", "type": "address"}, + { + "internalType": "uint256", + "name": "unstakeRequestIndex", + "type": "uint256" + }, + {"internalType": "uint256[]", "name": "keyIds", "type": "uint256[]"} + ], + "name": "unstakeKeys", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + {"internalType": "address", "name": "delegate", "type": "address"} + ], + "name": "updateDelegateOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + {"internalType": "string[3]", "name": "_metaData", "type": "string[3]"}, + {"internalType": "string[]", "name": "_socials", "type": "string[]"} + ], + "name": "updateMetadata", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + {"internalType": "uint32", "name": "_ownerShare", "type": "uint32"}, + {"internalType": "uint32", "name": "_keyBucketShare", "type": "uint32"}, + { + "internalType": "uint32", + "name": "_stakedBucketShare", + "type": "uint32" + }, + {"internalType": "uint256", "name": "period", "type": "uint256"} + ], + "name": "updateShares", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +]