diff --git a/src/__tests__/config/pools.test.ts b/src/__tests__/config/pools.test.ts index c3dbf8a5b8495..919a2ad9531bd 100644 --- a/src/__tests__/config/pools.test.ts +++ b/src/__tests__/config/pools.test.ts @@ -1,4 +1,10 @@ import pools from 'config/constants/pools' +import { getSouschefContract } from 'utils/contractHelpers' + +// Pool 0 is special (cake pool) +// Pool 78 is a broken pool, not used, and break the tests +const idsToRemove = [0, 78] +const poolsToTest = pools.filter((pool) => !idsToRemove.includes(pool.sousId)) describe('Config pools', () => { it.each(pools.map((pool) => pool.sousId))('Pool #%d has an unique sousId', (sousId) => { @@ -12,4 +18,20 @@ describe('Config pools', () => { expect(duplicates).toHaveLength(1) }, ) + it.each(poolsToTest.filter((pool) => pool.earningToken.symbol !== 'BNB'))( + 'Pool %p has the correct earning token', + async (pool) => { + const contract = getSouschefContract(pool.sousId) + const rewardTokenAddress = await contract.methods.rewardToken().call() + expect(rewardTokenAddress.toLowerCase()).toBe(pool.earningToken.address[56].toLowerCase()) + }, + ) + it.each(poolsToTest.filter((pool) => pool.stakingToken.symbol !== 'BNB'))( + 'Pool %p has the correct staking token', + async (pool) => { + const contract = getSouschefContract(pool.sousId) + const stakingTokenAddress = await contract.methods.syrup().call() + expect(stakingTokenAddress.toLowerCase()).toBe(pool.stakingToken.address[56].toLowerCase()) + }, + ) }) diff --git a/src/config/abi/sousChef.json b/src/config/abi/sousChef.json index 407670c5bb03a..32755859637a3 100644 --- a/src/config/abi/sousChef.json +++ b/src/config/abi/sousChef.json @@ -1,26 +1,11 @@ [ { "inputs": [ - { - "internalType": "contract IBEP20", - "name": "_syrup", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_rewardPerBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_startBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_endBlock", - "type": "uint256" - } + { "internalType": "contract IBEP20", "name": "_syrup", "type": "address" }, + { "internalType": "contract IBEP20", "name": "_rewardToken", "type": "address" }, + { "internalType": "uint256", "name": "_rewardPerBlock", "type": "uint256" }, + { "internalType": "uint256", "name": "_startBlock", "type": "uint256" }, + { "internalType": "uint256", "name": "_bonusEndBlock", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "constructor" @@ -28,18 +13,8 @@ { "anonymous": false, "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } + { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "Deposit", "type": "event" @@ -47,18 +22,8 @@ { "anonymous": false, "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } + { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "EmergencyWithdraw", "type": "event" @@ -66,18 +31,17 @@ { "anonymous": false, "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } + { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "user", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "Withdraw", "type": "event" @@ -85,186 +49,121 @@ { "inputs": [], "name": "bonusEndBlock", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { - "inputs": [], - "name": "poolInfo", - "outputs": [ - { - "internalType": "uint256", - "name": "lastRewardBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "accRewardPerShare", - "type": "uint256" - } + "inputs": [{ "internalType": "uint256", "name": "_amount", "type": "uint256" }], + "name": "deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "_amount", "type": "uint256" }], + "name": "emergencyRewardWithdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { "inputs": [], "name": "emergencyWithdraw", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { "internalType": "uint256", "name": "_from", "type": "uint256" }, + { "internalType": "uint256", "name": "_to", "type": "uint256" } ], + "name": "getMultiplier", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, + { "inputs": [], "name": "massUpdatePools", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], - "name": "rewardPerBlock", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], + "name": "owner", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { - "inputs": [], - "name": "startBlock", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], + "inputs": [{ "internalType": "address", "name": "_user", "type": "address" }], + "name": "pendingReward", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { - "inputs": [], - "name": "syrup", + "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "name": "poolInfo", "outputs": [ - { - "internalType": "contract IBEP20", - "name": "", - "type": "address" - } + { "internalType": "contract IBEP20", "name": "lpToken", "type": "address" }, + { "internalType": "uint256", "name": "allocPoint", "type": "uint256" }, + { "internalType": "uint256", "name": "lastRewardBlock", "type": "uint256" }, + { "internalType": "uint256", "name": "accCakePerShare", "type": "uint256" } ], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, + { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "userInfo", - "outputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rewardDebt", - "type": "uint256" - } - ], + "inputs": [], + "name": "rewardPerBlock", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { - "inputs": [ - { - "internalType": "uint256", - "name": "_from", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_to", - "type": "uint256" - } - ], - "name": "getMultiplier", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], + "inputs": [], + "name": "rewardToken", + "outputs": [{ "internalType": "contract IBEP20", "name": "", "type": "address" }], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "_user", - "type": "address" - } - ], - "name": "pendingReward", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], + "inputs": [], + "name": "startBlock", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", - "type": "function", - "constant": true + "type": "function" }, + { "inputs": [], "name": "stopReward", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], - "name": "updatePool", + "name": "syrup", + "outputs": [{ "internalType": "contract IBEP20", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], + "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { - "inputs": [ - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } - ], - "name": "deposit", + "inputs": [{ "internalType": "uint256", "name": "_pid", "type": "uint256" }], + "name": "updatePool", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { - "inputs": [ - { - "internalType": "uint256", - "name": "_amount", - "type": "uint256" - } + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "userInfo", + "outputs": [ + { "internalType": "uint256", "name": "amount", "type": "uint256" }, + { "internalType": "uint256", "name": "rewardDebt", "type": "uint256" } ], - "name": "withdraw", - "outputs": [], - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { - "inputs": [], - "name": "emergencyWithdraw", + "inputs": [{ "internalType": "uint256", "name": "_amount", "type": "uint256" }], + "name": "withdraw", "outputs": [], "stateMutability": "nonpayable", "type": "function" } -] \ No newline at end of file +]