Skip to content

Commit

Permalink
chore: add multiple recipcient
Browse files Browse the repository at this point in the history
  • Loading branch information
ohdcthang committed Aug 27, 2024
1 parent db5318f commit 1cd4042
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 300 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "3.1.0",
"version": "4.0.0",
"license": "MIT",
"main": "src/index.ts",
"types": "src/index.ts",
Expand Down
291 changes: 5 additions & 286 deletions src/constants/abi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -619,22 +619,6 @@ export const COIN98_GIFT_FACTORY_ABI = [
]

export const COIN98_GIFT_V2_ABI = [
{
"inputs": [
{
"internalType": "address",
"name": "randomizer",
"type": "address"
},
{
"internalType": "address",
"name": "broadcaster",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
Expand All @@ -660,38 +644,6 @@ export const COIN98_GIFT_V2_ABI = [
"name": "ClaimReward",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint8",
"name": "version",
"type": "uint8"
}
],
"name": "Initialized",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
Expand All @@ -717,49 +669,6 @@ export const COIN98_GIFT_V2_ABI = [
"name": "SubmitRewardRecipient",
"type": "event"
},
{
"stateMutability": "nonpayable",
"type": "fallback"
},
{
"inputs": [],
"name": "PERCENT",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "PROJECT_NAME",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "PROJECT_VERSION",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
Expand Down Expand Up @@ -805,24 +714,11 @@ export const COIN98_GIFT_V2_ABI = [
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "broadcaster",
"outputs": [
{
"internalType": "contract IBroadcaster",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_owner",
"name": "owner",
"type": "address"
}
],
Expand All @@ -844,188 +740,15 @@ export const COIN98_GIFT_V2_ABI = [
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "factory",
"outputs": [
{
"internalType": "contract ICoin98GiftFactoryV2",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getGiftConfig",
"outputs": [
{
"components": [
{
"internalType": "address",
"name": "rewardToken",
"type": "address"
},
{
"internalType": "uint256",
"name": "totalReward",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "totalSlots",
"type": "uint256"
},
{
"internalType": "uint16",
"name": "randomPercent",
"type": "uint16"
},
{
"internalType": "uint256",
"name": "baseMultiplier",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "meanRewardPerSlot",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "remainingReward",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "remainingSlots",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "endTimestamp",
"type": "uint256"
}
],
"internalType": "struct ICoin98GiftV2.Config",
"name": "",
"type": "tuple"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"internalType": "address[]",
"name": "recipient",
"type": "address"
}
],
"name": "getInsertedSlot",
"outputs": [
{
"components": [
{
"internalType": "uint256",
"name": "slotNumber",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "reward",
"type": "uint256"
},
{
"internalType": "bool",
"name": "isInserted",
"type": "bool"
},
{
"internalType": "bool",
"name": "isClaimed",
"type": "bool"
}
],
"internalType": "struct ICoin98GiftV2.Slot",
"name": "",
"type": "tuple"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getRandomizer",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "projectKey",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "rewardRecipient",
"type": "address"
"type": "address[]"
}
],
"name": "submitRewardRecipient",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"name": "submitRewardRecipients",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
Expand All @@ -1052,18 +775,14 @@ export const COIN98_GIFT_V2_ABI = [
"inputs": [
{
"internalType": "address",
"name": "_owner",
"name": "owner",
"type": "address"
}
],
"name": "withdrawRemainingReward",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"stateMutability": "payable",
"type": "receive"
}
]

Expand Down
10 changes: 5 additions & 5 deletions src/constants/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ export enum CONTRACT_NAME {

export const GIFT_CONTRACT = (contractName: CONTRACT_NAME, isDev: boolean = true): string => {
const contracts : Record<CONTRACT_NAME, string> = {
"BROADCASTER_CONTRACT_ADDRESS" : isDev? '0x8C9980d4492a748C9ecAcf474aA87C8215C8df88' : "0x5C8ABc6B9d669405BCB46aF982A4A9d53Ed9d2e7",
"RANDOMIZER_CONTRACT_ADDRESS" : isDev? '0x312C8c4a5E43D5Ff26EEB360119631ED88d500af' : "0x9822bF0915D1FDc29C5eaA68c93E115A8F3303Dd",
"COIN98_GIFT_CONTRACT_ADDRESS": isDev? '0xad4A3c0e519Ac7b7334e1Ba7a6D517D2cBc2F255' : "0xf25F71E761C09b18979aADAF1433104EE1945CBF",
"COIN98_GIFT_FACTORY_CONTRACT_ADDRESS": isDev? '0x2f04031b05Af536e12e480bb877BC076989A6EAd' : "0xF827A1389d206194dEe7624F25015B86b376F26A",
"GAS_SPONSOR_CONTRACT_ADDRESS": isDev? '0x9069a3cB070B104fA5bEcf1fcb97af1Edc0D8343' : "0x095e458725ce80C54F2D595E4Ac4868B247DCC9e"
"BROADCASTER_CONTRACT_ADDRESS" : isDev? '0x425b8B480cFf9911120e74b0F917d621aC80a002' : "0x5C8ABc6B9d669405BCB46aF982A4A9d53Ed9d2e7",
"RANDOMIZER_CONTRACT_ADDRESS" : isDev? '0xF7358FA54f269a2fD22b0b79bD5DaC275F159459' : "0x9822bF0915D1FDc29C5eaA68c93E115A8F3303Dd",
"COIN98_GIFT_CONTRACT_ADDRESS": isDev? '0x39841cA43709196B99fF0567172c532168c245ac' : "0xf25F71E761C09b18979aADAF1433104EE1945CBF",
"COIN98_GIFT_FACTORY_CONTRACT_ADDRESS": isDev? '0xFeb98A0a08Fbf51b4614Cc4b914CC05677A004fF' : "0xF827A1389d206194dEe7624F25015B86b376F26A",
"GAS_SPONSOR_CONTRACT_ADDRESS": isDev? '0x37F1cd0C822843595373aB9E0a5F09B6107b2dB6' : "0x095e458725ce80C54F2D595E4Ac4868B247DCC9e"
}
return contracts[contractName]
}
Loading

0 comments on commit 1cd4042

Please sign in to comment.