From 4472b54f302c073e3af2f8f3d56c00b97e14ae2a Mon Sep 17 00:00:00 2001 From: supermars01 Date: Sat, 24 Oct 2020 19:59:10 +0800 Subject: [PATCH 1/3] add dUSD pool --- web-front/src/assets/dUSD.svg | 1 + .../src/components/dashboard/dashboard.jsx | 7 +- web-front/src/components/header/header.jsx | 8 +- .../components/rewardPools/rewardPools.jsx | 109 +- web-front/src/components/stake/stake.jsx | 282 +- web-front/src/config/env.js | 3791 +++++++++++++++-- web-front/src/language/en_US.js | 6 +- web-front/src/language/zh_CN.js | 6 +- web-front/src/stores/store.jsx | 355 +- 9 files changed, 3992 insertions(+), 573 deletions(-) create mode 100644 web-front/src/assets/dUSD.svg diff --git a/web-front/src/assets/dUSD.svg b/web-front/src/assets/dUSD.svg new file mode 100644 index 0000000..d77e0ed --- /dev/null +++ b/web-front/src/assets/dUSD.svg @@ -0,0 +1 @@ +333 \ No newline at end of file diff --git a/web-front/src/components/dashboard/dashboard.jsx b/web-front/src/components/dashboard/dashboard.jsx index 58977df..a274ad2 100644 --- a/web-front/src/components/dashboard/dashboard.jsx +++ b/web-front/src/components/dashboard/dashboard.jsx @@ -36,7 +36,9 @@ class DashBoard extends Component { "GOLDx/USDx": GOLDx_logo, "USDx/USDC":USDx_USDC_logo }; - const dashboardData = rewardPools.map((rp) => ({ + let dashboardData = rewardPools.map((rp) => + // 判断是 dUSD-SFG/DF 逻辑 则不展示 数据 + (rp.id !== 'dUSD') && ({ poolUrlParam: rp.id, rp, logo: svgLogo[rp.id], @@ -46,6 +48,8 @@ class DashBoard extends Component { AvailableToClaim: "...", rewardsAvailable: "...", })); + dashboardData = dashboardData.filter(item=> item !==false) + // 判断是 dUSD-SFG/DF 逻辑 则不展示 数据 this.state = { rewardPools, loading: !account, @@ -132,6 +136,7 @@ class DashBoard extends Component { this.setState(() => ({ modalOpen: false, })); + console.log(dashboardData) const web3 = new Web3(store.getStore("web3context").library.provider); let bn = web3.utils.toBN; const poolsContract = await Promise.all( diff --git a/web-front/src/components/header/header.jsx b/web-front/src/components/header/header.jsx index a204185..7c398c0 100644 --- a/web-front/src/components/header/header.jsx +++ b/web-front/src/components/header/header.jsx @@ -125,9 +125,9 @@ export default class App extends React.Component {
- dForce Swap +
@@ -243,10 +243,10 @@ export default class App extends React.Component {
- dForce Swap + - +
diff --git a/web-front/src/components/rewardPools/rewardPools.jsx b/web-front/src/components/rewardPools/rewardPools.jsx index 1832cd2..04389cf 100644 --- a/web-front/src/components/rewardPools/rewardPools.jsx +++ b/web-front/src/components/rewardPools/rewardPools.jsx @@ -198,21 +198,21 @@ const styles = theme => ({ display:'flex', justifyContent:'center', alignItems:'center', - '& a':{ - color:'rgba(67,73,118,1)', - textDecoration:'underline', - // display:'block', - // width:'10px', - // height:'10px', - // margin:'0 0 12px 14px', - // backgroundImage:'url('+require('../../assets/pool-link-icon.svg')+')', - // backgroundSize:'auto', - // backgroundRepeat:'no-repeat', - '&:hover':{ - color:'#BA59FF' - // backgroundImage:'url('+require('../../assets/pool-linked-icon.svg')+')', - } - }, + // '& a':{ + // color:'rgba(67,73,118,1)', + // textDecoration:'underline', + // // display:'block', + // // width:'10px', + // // height:'10px', + // // margin:'0 0 12px 14px', + // // backgroundImage:'url('+require('../../assets/pool-link-icon.svg')+')', + // // backgroundSize:'auto', + // // backgroundRepeat:'no-repeat', + // '&:hover':{ + // color:'#BA59FF' + // // backgroundImage:'url('+require('../../assets/pool-linked-icon.svg')+')', + // } + // }, }, poolName: { height: '25px', @@ -222,6 +222,13 @@ const styles = theme => ({ lineHeight: '19px', marginBottom: '8px' }, + underLine:{ + color:'rgba(67,73,118,1)', + textDecoration:'underline', + '&:hover':{ + color:'#BA59FF' + } + }, tokensList: { color: '#A4A7BE', marginBottom: '10px', @@ -349,6 +356,14 @@ const styles = theme => ({ margin: '20px auto 15px' } }, + svgCenterdUSD: { + width: '80px', + height: '80px', + margin: '20px auto 20px', + [theme.breakpoints.down('md')]: { + margin: '20px auto 20px' + } + }, // poolAPY poolApy:{ width:'874px', @@ -567,12 +582,14 @@ class RewardPools extends Component { : + rp.id !== 'dUSD'? {ROI[rp.id] ? this.formatAPYNumber(ROI[rp.id]*100)+'%' : '...'} 0.00% {ROI[rp.id] ? this.formatAPYNumber(ROI[rp.id]*100)+'%' : '...'} + :<> )) } @@ -663,7 +680,7 @@ class RewardPools extends Component { { rewardPool.map(rp=>(
- Uniswap {rp.id} + Uniswap {rp.id} {/* */}
)) @@ -691,28 +708,44 @@ class RewardPools extends Component { return (
{/*
*/} - Uniswap {rewardPool.id} - {rewardPool.website} -
- - {/* */} - {/* */} - - {/* */} - {/* */} - {/* {rewardPool.tokens.length > 0 && "Supported Tokens: " + tokensList} - {rewardPool.tokens.length == 0 && "No supported tokens currently"} */} - - {/*
- { -
- - {ROI[rewardPool.tokens[0].ROI] ? this.formatAPYNumber(ROI[rewardPool.tokens[0].ROI]*100)+'%' : '...'} - -
- } -
*/} -
{ if (rewardPool.tokens.length > 0) { this.navigateStake(rewardPool) } }}>
+ {/* { + rewardPool.id === 'dUSD'? + <> + {rewardPool.id} + {rewardPool.website} +
+ + + +
{ if (rewardPool.tokens.length > 0) { this.navigateStake(rewardPool) } }}> +
+ + : + <> */} + {rewardPool.id} + {rewardPool.website} +
+ + {/* */} + {/* */} + + {/* */} + {/* */} + {/* {rewardPool.tokens.length > 0 && "Supported Tokens: " + tokensList} + {rewardPool.tokens.length == 0 && "No supported tokens currently"} */} + + {/*
+ { +
+ + {ROI[rewardPool.tokens[0].ROI] ? this.formatAPYNumber(ROI[rewardPool.tokens[0].ROI]*100)+'%' : '...'} + +
+ } +
*/} +
{ if (rewardPool.tokens.length > 0) { this.navigateStake(rewardPool) } }}>
+ {/* + } */}
) } } diff --git a/web-front/src/components/stake/stake.jsx b/web-front/src/components/stake/stake.jsx index b9761d7..5720705 100644 --- a/web-front/src/components/stake/stake.jsx +++ b/web-front/src/components/stake/stake.jsx @@ -211,10 +211,30 @@ const styles = (theme) => ({ // marginBottom:'0' // } }, + lastdUSDField:{ + display: "flex", + alignItems: "center", + flex: "1", + flexDirection: "column", + borderRight: "0", + paddingTop:"15px", + [theme.breakpoints.down("md")]: { + paddingTop:"10px", + } + }, + overviewTitledUSD: { + color: "#A4A7BE", + fontSize: "14px", + marginBottom: "7px", + [theme.breakpoints.down("md")]: { + fontSize: "12px", + marginBottom: "4px", + }, + }, overviewTitle: { color: "#A4A7BE", fontSize: "14px", - marginBottom: "13px", + marginBottom: "17px", [theme.breakpoints.down("md")]: { fontSize: "12px", marginBottom: "8px", @@ -750,36 +770,39 @@ class Stake extends Component { // }) // }) // .catch(e => console.log("Oops, error", e)) - setTimeout(async () => { - const { account } = this.state; - if ( - !Object.getOwnPropertyNames(account).length || - account.address === undefined - ) { - this.setState(() => ({ - modalOpen: true, - })); - } - if (store.getStore("web3context") !== null) { - const asset = this.state.pool; - const web3 = new Web3(store.getStore("web3context").library.provider); - const LockContract = new web3.eth.Contract( - asset.tokens[0].rewardsABI, - asset.tokens[0].rewardsAddress - ); - // return; - const Locked = await LockContract.methods.lockedDetails().call(); - - if (Locked[0]) { - this.setState({ - unstakeLock: true, - timeStamp: Locked[1], - }); - } else { - console.log(Locked); + const asset = this.state.pool; + if(asset.id !== 'dUSD'){ + setTimeout(async () => { + const { account } = this.state; + if ( + !Object.getOwnPropertyNames(account).length || + account.address === undefined + ) { + this.setState(() => ({ + modalOpen: true, + })); } - } - }, 1000); + if (store.getStore("web3context") !== null) { + // const asset = this.state.pool; + const web3 = new Web3(store.getStore("web3context").library.provider); + const LockContract = new web3.eth.Contract( + asset.tokens[0].rewardsABI, + asset.tokens[0].rewardsAddress + ); + // return; + const Locked = await LockContract.methods.lockedDetails().call(); + + if (Locked[0]) { + this.setState({ + unstakeLock: true, + timeStamp: Locked[1], + }); + } else { + console.log(Locked); + } + } + }, 1000); + } } componentWillUnmount() { emitter.removeListener(CONNECTION_CONNECTED, this.connectionConnected); @@ -965,7 +988,12 @@ class Stake extends Component {

- + { + (pool.id !== 'dUSD')? + + : + + }

@@ -1023,29 +1051,56 @@ class Stake extends Component { {pool.tokens[0].symbol}
-
- +
+ - {/* {pool.tokens[0].rewardsSymbol == '$' ? pool.tokens[0].rewardsSymbol : ''} {pool.tokens[0].rewardsAvailable ? pool.tokens[0].rewardsAvailable.toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,') : "0"} {pool.tokens[0].rewardsSymbol != '$' ? pool.tokens[0].rewardsSymbol : ''} */} - - {pool.tokens[0].rewardsSymbol == "$" - ? pool.tokens[0].rewardsSymbol - : ""} - {pool.tokens[0].rewardsAvailable - ? - // ( - // pool.tokens[0].rewardsAvailable / - // 10 ** pool.tokens[0].rewardsDecimal - // ) - // .toFixed(2) - // .replace(/(\d)(?=(\d{3})+\.)/g, "$1,") - this.formatNumber(pool.tokens[0].rewardsAvailable, pool.tokens[0].decimals, 4) - : "0"}  - {pool.tokens[0].rewardsSymbol != "$" - ? pool.tokens[0].rewardsSymbol - : ""} - + { + // dUSD-SFG/DF + + (pool.id === 'dUSD')? + <> + + {pool.tokens[0].rewardsSymbol[0] == "$" + ? pool.tokens[0].rewardsSymbol[0] + : ""} + {pool.tokens[0].rewardsAvailable[0] + ? + this.formatNumber(pool.tokens[0].rewardsAvailable[0], pool.tokens[0].decimals, 4) + : "0"}  + {pool.tokens[0].rewardsSymbol[0] != "$" + ? pool.tokens[0].rewardsSymbol[0] + : ""} + + + {pool.tokens[0].rewardsSymbol[1] == "$" + ? pool.tokens[0].rewardsSymbol[1] + : ""} + {pool.tokens[0].rewardsAvailable[1] + ? + this.formatNumber(pool.tokens[0].rewardsAvailable[1], pool.tokens[0].decimals, 4) + : "0"}  + {pool.tokens[0].rewardsSymbol[1] != "$" + ? pool.tokens[0].rewardsSymbol[1] + : ""} + + + + // dUSD-SFG/DF + : + + {pool.tokens[0].rewardsSymbol == "$" + ? pool.tokens[0].rewardsSymbol + : ""} + {pool.tokens[0].rewardsAvailable + ? + this.formatNumber(pool.tokens[0].rewardsAvailable, pool.tokens[0].decimals, 4) + : "0"}  + {pool.tokens[0].rewardsSymbol != "$" + ? pool.tokens[0].rewardsSymbol + : ""} + + }
{/*
@@ -1092,47 +1147,92 @@ class Stake extends Component { voteLock, unstakeLock, } = this.state; - return (
-
-
- -
-
-
- -
+ + // 判断是 dUSD-SFG/DF claim SFG 逻辑End + : + <> +
+ +
+
+ +
+ + } {pool.id === "Governance" && voteLockValid && ( Unstaking tokens only allowed once all your pending votes have @@ -1337,7 +1437,7 @@ class Stake extends Component { } }; - onClaim = () => { + onClaim = (RewardsSymbol) => { const { pool } = this.state; const tokens = pool.tokens; const selectedToken = tokens[0]; @@ -1345,7 +1445,7 @@ class Stake extends Component { this.setState({ loading: true }); dispatcher.dispatch({ type: GET_REWARDS, - content: { asset: selectedToken }, + content: { asset: selectedToken,RewardsSymbol }, }); }; diff --git a/web-front/src/config/env.js b/web-front/src/config/env.js index e10e213..86abf91 100644 --- a/web-front/src/config/env.js +++ b/web-front/src/config/env.js @@ -494,7 +494,1519 @@ function env() { "stateMutability": "view", "type": "function" } - ], + ], + SMinter:[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousGovernor", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newGovernor", + "type": "address" + } + ], + "name": "GovernorshipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "reward_contract", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minted", + "type": "uint256" + } + ], + "name": "Minted", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "allowed_to_mint_for", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "controller", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "getConfig", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "getConfig", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "getConfig", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "governor", + "type": "address" + }, + { + "internalType": "address", + "name": "token_", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "governor_", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "gauge", + "type": "address" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "gauge", + "type": "address" + }, + { + "internalType": "address", + "name": "_for", + "type": "address" + } + ], + "name": "mint_for", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "gauges", + "type": "address[]" + } + ], + "name": "mint_many", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[8]", + "name": "gauges", + "type": "address[8]" + } + ], + "name": "mint_many", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "minted", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "quotas", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceGovernorship", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "setConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "setConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "setConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "gauge", + "type": "address" + }, + { + "internalType": "uint256", + "name": "quota", + "type": "uint256" + } + ], + "name": "setGaugeQuota", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minting_user", + "type": "address" + } + ], + "name": "toggle_approve_mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newGovernor", + "type": "address" + } + ], + "name": "transferGovernorship", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + DForceGauge:[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "provider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Deposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousGovernor", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newGovernor", + "type": "address" + } + ], + "name": "GovernorshipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "original_balance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "original_supply", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "working_balance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "working_supply", + "type": "uint256" + } + ], + "name": "UpdateLiquidityLimit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "provider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Withdraw", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "approved_to_deposit", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "bufReward", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "claim_rewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "claim_rewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "claimable_reward", + "outputs": [ + { + "internalType": "uint256", + "name": "r", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "claimable_tokens", + "outputs": [ + { + "internalType": "uint256", + "name": "r", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "claimed_rewards_for", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "claimed_rewards_for_", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "controller", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "crv_token", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "end", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "future_epoch_time", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "getConfig", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "getConfig", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "getConfig", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "inflation_rate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "governor", + "type": "address" + }, + { + "internalType": "address", + "name": "_minter", + "type": "address" + }, + { + "internalType": "address", + "name": "_lp_token", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "governor_", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "governor", + "type": "address" + }, + { + "internalType": "address", + "name": "_minter", + "type": "address" + }, + { + "internalType": "address", + "name": "_lp_token", + "type": "address" + }, + { + "internalType": "address", + "name": "rewardPool", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "integrate_checkpoint", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "integrate_checkpoint_of", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "integrate_fraction", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "integrate_inv_supply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "integrate_inv_supply_of", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "kick", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "lasttime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "lp_token", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minter", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "period", + "outputs": [ + { + "internalType": "int128", + "name": "", + "type": "int128" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "period_timestamp", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceGovernorship", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "reward_contract", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "reward_integral", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "reward_integral_", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "reward_integral_for", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "reward_integral_for_", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rewarded_token", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "rewards_for", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "rewards_for_", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "setConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "setConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "setConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_span", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isLinear", + "type": "bool" + } + ], + "name": "setSpan", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "bool", + "name": "can_deposit", + "type": "bool" + } + ], + "name": "set_approve_deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "span", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "sumMiningPer", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "sumMiningPerOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newGovernor", + "type": "address" + } + ], + "name": "transferGovernorship", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "user_checkpoint", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "voting_escrow", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_claim_rewards", + "type": "bool" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "working_balances", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "working_supply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } + ], // kovan // UniswapDF_ETH_Token: '0x308777dDEC61F5000D8394626d55dbB0312fe874', // DF_ETH_RewardsAddress: '0x232818620877fd9232e9ADe0c91EF5518EB11788', @@ -526,7 +2038,11 @@ function env() { UniswapUSDx_USDC: '0x460067f15e9B461a5F4c482E80217A2F45269385', USDx_USDC_RewardsAddress: '0xa94E2074BeB6D1Bf28014b81Ff2062eaB3600c48', - + // dUSD-SFG/DF + UniswapdUSD_SFG: '0x5C6FEE8A740F3DEC04b432535F7dA6C0428EB414', + SMinter_RewardsAddress: '0x3b46D3C8Aea72575C2C17f5604A0916e5A994A3b', + DForceGauge_RewardsAddress: '0x70F3BA04Fd98013f8a755362e05fE8aE3Eb02AdA', + // dUSD-SFG/DF dUSDT_dToken_Address: '0x868277d475E0e475E38EC5CdA2d9C83B5E1D9fc8', dUSDT_RewardsAddress: '0x324EebDAa45829c6A8eE903aFBc7B61AF48538df', @@ -544,517 +2060,2028 @@ function env() { infuraProvider: 'https://mainnet.infura.io/v3/3903dd30564147e5a22b76dc79815e2a', balancerRewardsABI: [ { - "constant": false, + "constant": false, + "inputs": [], + "name": "exit", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "getReward", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "reward", + "type": "uint256" + } + ], + "name": "notifyRewardAmount", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "constant": false, + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "reward", + "type": "uint256" + } + ], + "name": "RewardAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "reward", + "type": "uint256" + } + ], + "name": "RewardPaid", + "type": "event" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "_rewardDistribution", + "type": "address" + } + ], + "name": "setRewardDistribution", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "stake", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Staked", + "type": "event" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "stakeFor", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Withdrawn", + "type": "event" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "df", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "DURATION", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "earned", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "hasLockedTime", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "isOwner", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "lastTimeRewardApplicable", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "lastUpdateTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "lockedDetails", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "periodFinish", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "rewardPerToken", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "rewardPerTokenStored", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "rewardRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "rewards", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "uni", + "outputs": [ + { + "internalType": "contract IERC20", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "userRewardPerTokenPaid", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + } + ], + SMinter:[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousGovernor", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newGovernor", + "type": "address" + } + ], + "name": "GovernorshipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "reward_contract", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "minted", + "type": "uint256" + } + ], + "name": "Minted", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "allowed_to_mint_for", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "controller", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "getConfig", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "getConfig", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "getConfig", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "governor", + "type": "address" + }, + { + "internalType": "address", + "name": "token_", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "governor_", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "gauge", + "type": "address" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "gauge", + "type": "address" + }, + { + "internalType": "address", + "name": "_for", + "type": "address" + } + ], + "name": "mint_for", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "gauges", + "type": "address[]" + } + ], + "name": "mint_many", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[8]", + "name": "gauges", + "type": "address[8]" + } + ], + "name": "mint_many", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "minted", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "quotas", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceGovernorship", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "setConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "setConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "setConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "gauge", + "type": "address" + }, + { + "internalType": "uint256", + "name": "quota", + "type": "uint256" + } + ], + "name": "setGaugeQuota", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minting_user", + "type": "address" + } + ], + "name": "toggle_approve_mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newGovernor", + "type": "address" + } + ], + "name": "transferGovernorship", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + DForceGauge:[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "provider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Deposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousGovernor", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newGovernor", + "type": "address" + } + ], + "name": "GovernorshipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "original_balance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "original_supply", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "working_balance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "working_supply", + "type": "uint256" + } + ], + "name": "UpdateLiquidityLimit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "provider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Withdraw", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "approved_to_deposit", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], - "name": "exit", + "name": "bufReward", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "claim_rewards", "outputs": [], - "payable": false, "stateMutability": "nonpayable", "type": "function" - }, - { - "constant": false, + }, + { + "inputs": [], + "name": "claim_rewards", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "claimable_reward", + "outputs": [ + { + "internalType": "uint256", + "name": "r", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "claimable_tokens", + "outputs": [ + { + "internalType": "uint256", + "name": "r", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "claimed_rewards_for", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "claimed_rewards_for_", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "controller", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], - "name": "getReward", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", + "name": "crv_token", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", "type": "function" - }, - { - "constant": false, + }, + { "inputs": [ - { - "internalType": "uint256", - "name": "reward", - "type": "uint256" - } + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "addr", + "type": "address" + } ], - "name": "notifyRewardAmount", + "name": "deposit", "outputs": [], - "payable": false, "stateMutability": "nonpayable", "type": "function" - }, - { - "anonymous": false, + }, + { "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "constant": false, - "inputs": [], - "name": "renounceOwnership", + "name": "deposit", "outputs": [], - "payable": false, "stateMutability": "nonpayable", "type": "function" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "reward", - "type": "uint256" - } + }, + { + "inputs": [], + "name": "end", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } ], - "name": "RewardAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "reward", - "type": "uint256" - } + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "future_epoch_time", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } ], - "name": "RewardPaid", - "type": "event" - }, - { - "constant": false, + "stateMutability": "view", + "type": "function" + }, + { "inputs": [ - { - "internalType": "address", - "name": "_rewardDistribution", - "type": "address" - } + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "addr", + "type": "address" + } ], - "name": "setRewardDistribution", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", + "name": "getConfig", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", "type": "function" - }, - { - "constant": false, + }, + { "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } ], - "name": "stake", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", + "name": "getConfig", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", "type": "function" - }, - { - "anonymous": false, + }, + { "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } ], - "name": "Staked", - "type": "event" - }, - { - "constant": false, + "name": "getConfig", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "inflation_rate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } + { + "internalType": "address", + "name": "governor", + "type": "address" + }, + { + "internalType": "address", + "name": "_minter", + "type": "address" + }, + { + "internalType": "address", + "name": "_lp_token", + "type": "address" + } ], - "name": "stakeFor", + "name": "initialize", "outputs": [], - "payable": false, "stateMutability": "nonpayable", "type": "function" - }, - { - "constant": false, + }, + { "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } + { + "internalType": "address", + "name": "governor_", + "type": "address" + } ], - "name": "transferOwnership", + "name": "initialize", "outputs": [], - "payable": false, "stateMutability": "nonpayable", "type": "function" - }, - { - "constant": false, + }, + { "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } + { + "internalType": "address", + "name": "governor", + "type": "address" + }, + { + "internalType": "address", + "name": "_minter", + "type": "address" + }, + { + "internalType": "address", + "name": "_lp_token", + "type": "address" + }, + { + "internalType": "address", + "name": "rewardPool", + "type": "address" + } ], - "name": "withdraw", + "name": "initialize", "outputs": [], - "payable": false, "stateMutability": "nonpayable", "type": "function" - }, - { - "anonymous": false, + }, + { + "inputs": [], + "name": "integrate_checkpoint", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } + { + "internalType": "address", + "name": "", + "type": "address" + } ], - "name": "Withdrawn", - "type": "event" - }, - { - "constant": true, + "name": "integrate_checkpoint_of", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } + { + "internalType": "address", + "name": "", + "type": "address" + } ], - "name": "balanceOf", + "name": "integrate_fraction", "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } ], - "payable": false, "stateMutability": "view", "type": "function" - }, - { - "constant": true, + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "integrate_inv_supply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "integrate_inv_supply_of", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "kick", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { "inputs": [], - "name": "df", + "name": "lasttime", "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } ], - "payable": false, "stateMutability": "view", "type": "function" - }, - { - "constant": true, + }, + { + "inputs": [], + "name": "lp_token", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minter", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], - "name": "DURATION", + "name": "period", "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } + { + "internalType": "int128", + "name": "", + "type": "int128" + } ], - "payable": false, "stateMutability": "view", "type": "function" - }, - { - "constant": true, + }, + { "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } ], - "name": "earned", + "name": "period_timestamp", "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } ], - "payable": false, "stateMutability": "view", "type": "function" - }, - { - "constant": true, + }, + { "inputs": [], - "name": "hasLockedTime", + "name": "renounceGovernorship", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "reward_contract", "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } + { + "internalType": "address", + "name": "", + "type": "address" + } ], - "payable": false, "stateMutability": "view", "type": "function" - }, - { - "constant": true, + }, + { "inputs": [], - "name": "isOwner", + "name": "reward_integral", "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } ], - "payable": false, "stateMutability": "view", "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "lastTimeRewardApplicable", + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "reward_integral_", "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } ], - "payable": false, "stateMutability": "view", "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "lastUpdateTime", + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "reward_integral_for", "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } ], - "payable": false, "stateMutability": "view", "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "lockedDetails", + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "reward_integral_for_", "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } ], - "payable": false, "stateMutability": "view", "type": "function" - }, - { - "constant": true, + }, + { "inputs": [], - "name": "owner", + "name": "rewarded_token", "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } + { + "internalType": "address", + "name": "", + "type": "address" + } ], - "payable": false, "stateMutability": "view", "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "periodFinish", + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "rewards_for", "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } ], - "payable": false, "stateMutability": "view", "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "rewardPerToken", + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "rewards_for_", "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } ], - "payable": false, "stateMutability": "view", "type": "function" - }, - { - "constant": true, + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "setConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "setConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "setConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_span", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isLinear", + "type": "bool" + } + ], + "name": "setSpan", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + }, + { + "internalType": "bool", + "name": "can_deposit", + "type": "bool" + } + ], + "name": "set_approve_deposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { "inputs": [], - "name": "rewardPerTokenStored", + "name": "span", "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } ], - "payable": false, "stateMutability": "view", "type": "function" - }, - { - "constant": true, + }, + { "inputs": [], - "name": "rewardRate", + "name": "sumMiningPer", "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } ], - "payable": false, "stateMutability": "view", "type": "function" - }, - { - "constant": true, + }, + { "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } + { + "internalType": "address", + "name": "", + "type": "address" + } ], - "name": "rewards", + "name": "sumMiningPerOf", "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } ], - "payable": false, "stateMutability": "view", "type": "function" - }, - { - "constant": true, + }, + { "inputs": [], "name": "totalSupply", "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } ], - "payable": false, "stateMutability": "view", "type": "function" - }, - { - "constant": true, + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newGovernor", + "type": "address" + } + ], + "name": "transferGovernorship", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "user_checkpoint", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { "inputs": [], - "name": "uni", + "name": "voting_escrow", "outputs": [ - { - "internalType": "contract IERC20", - "name": "", - "type": "address" - } + { + "internalType": "address", + "name": "", + "type": "address" + } ], - "payable": false, "stateMutability": "view", "type": "function" - }, - { - "constant": true, + }, + { "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } ], - "name": "userRewardPerTokenPaid", + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "_claim_rewards", + "type": "bool" + } + ], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "working_balances", "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } ], - "payable": false, "stateMutability": "view", "type": "function" - } + }, + { + "inputs": [], + "name": "working_supply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } ], - UniswapDF_ETH_Token: '0x232818620877fd9232e9ADe0c91EF5518EB11788', DF_ETH_RewardsAddress: '0x308777dDEC61F5000D8394626d55dbB0312fe874', @@ -1067,6 +4094,12 @@ function env() { UniswapUSDx_USDC: '0x460067f15e9B461a5F4c482E80217A2F45269385', USDx_USDC_RewardsAddress: '0xa94E2074BeB6D1Bf28014b81Ff2062eaB3600c48', + // dUSD-SFG/DF + UniswapdUSD_SFG: '0x5C6FEE8A740F3DEC04b432535F7dA6C0428EB414', + SMinter_RewardsAddress: '0x3b46D3C8Aea72575C2C17f5604A0916e5A994A3b', + DForceGauge_RewardsAddress: '0x70F3BA04Fd98013f8a755362e05fE8aE3Eb02AdA', + // dUSD-SFG/DF + dUSDT_dToken_Address: '0x868277d475E0e475E38EC5CdA2d9C83B5E1D9fc8', dUSDT_RewardsAddress: '0x324EebDAa45829c6A8eE903aFBc7B61AF48538df', diff --git a/web-front/src/language/en_US.js b/web-front/src/language/en_US.js index 6f76919..5d4a031 100644 --- a/web-front/src/language/en_US.js +++ b/web-front/src/language/en_US.js @@ -12,7 +12,8 @@ const en_US = { history: 'Recent Transactions', swap: 'SWAP', connect: 'Connect', - slogon: 'Stable Assets Swap', + dForceTrade: 'dForce Trade', + slogon: 'DEX aggregator', no_history: 'No History', Contract_US: 'Contact', Community: 'Community', @@ -36,6 +37,7 @@ const en_US = { dToken:'Champagne Tower Pool', DF_DF:'Singularity Pool', DF_USDx_USDC:'Champagne Tower Pool', + DF_dUSD:'Champagne Tower Pool', DF_GOLDx_USDx:'$GOLDx Rush Pool', dToken_APY:'Champagne Tower dToken', DF_APY:'Singularity', @@ -48,6 +50,7 @@ const en_US = { open: 'Open', Staking_title: 'dForce (DF) Liquidity Mining', Staking_subTitle: 'Participate in dForce liquidity mining by staking and earn DF rewards', + Staking_dUSD_subTitle: 'Participate in dForce liquidity mining by staking and earn DF/SFG rewards', Your_Balance: 'Your Balance', Currently_Staked: 'Currently Staked', Available_to_Claim: 'Available to Claim', @@ -58,6 +61,7 @@ const en_US = { STAKE: 'STAKE', UNSTAKE: 'UNSTAKE', Claim_DF: 'Claim DF', + Claim_SFG: 'Claim SFG', Exit_Claim_and_Unstake: 'Exit: Claim and Unstake', unstake_lock_title1: 'Lock-up period for pledged assets will end by:' } diff --git a/web-front/src/language/zh_CN.js b/web-front/src/language/zh_CN.js index 96e45ca..7f641d7 100644 --- a/web-front/src/language/zh_CN.js +++ b/web-front/src/language/zh_CN.js @@ -12,7 +12,8 @@ const zh_CN = { history: '历史', swap: '兑换', connect: '连接钱包', - slogon: '稳定资产闪兑', + dForceTrade: 'dForce Trade', + slogon: '去中心化交易聚合器', no_history: '没有历史记录', Contract_US: '联系我们', Community: '社区', @@ -36,6 +37,7 @@ const zh_CN = { dToken:'香槟塔池', DF_DF:'奇点池', DF_USDx_USDC:'香槟塔池', + DF_dUSD:'香槟塔池', DF_GOLDx_USDx:'淘金池', dToken_APY:'香槟塔池dToken', DF_APY:'奇点池', @@ -48,6 +50,7 @@ const zh_CN = { open: '开始', Staking_title: 'dForce(DF)质押挖矿', Staking_subTitle: '参与dForce流动性质押挖矿并获得DF激励', + Staking_dUSD_subTitle: '参与dForce流动性质押挖矿并获得DF和SFG激励', Your_Balance: '余额', Currently_Staked: '已质押量', Available_to_Claim: '可取数量', @@ -59,6 +62,7 @@ const zh_CN = { STAKE: '质押', UNSTAKE: '提取质押', Claim_DF: '提取DF', + Claim_SFG: '提取SFG', Exit_Claim_and_Unstake: '退出质押', // unstake_lock_title1: '只有在', unstake_lock_title1: '抵押资产解锁期限为:', diff --git a/web-front/src/stores/store.jsx b/web-front/src/stores/store.jsx index 6ba93b0..c1bbcc9 100644 --- a/web-front/src/stores/store.jsx +++ b/web-front/src/stores/store.jsx @@ -258,6 +258,38 @@ class Store { } ] }, + // dUSD-SFG/DF + { + id: 'dUSD', + urlParam:'dUSD', + name: 'Uniswap Exchange', // USDx: 0x33284741d62914C97E7DEF7B4B21550138Bc7d5c USDC: 0xb7a4F3E9097C08dA09517b5aB877F7a917224ede + website: 'S.finance', + link: 'https://s.finance/liquidity/dusd', + // icon: require('../assets/img2.svg'), + logo: require('../assets/dUSD.svg'), + tokens: [ + { + id: 'bpt', + address: config.UniswapdUSD_SFG, + // address: '0x7a71d2789Cf6b13aE25CA19DFD36c4925E7BD582', + symbol: 'dUSD', + // ROI:'dUSD_SFG', + type:'Rush_Pool', + Rush_type:'dUSD', + abi: config.erc20ABI, + decimals: 18, + rewardsAddress: [config.SMinter_RewardsAddress,config.DForceGauge_RewardsAddress], // 0x2C196aF9540420E9F0716BfD8c9bF5fC9C3E227d + rewardsABI: [config.SMinter,config.DForceGauge], + rewardsSymbol: ['SFG','DF'], + rewardsDecimal: 0, + balance: 0, + stakedBalance: 0, + // 可claim 的 token balance + rewardsAvailable: [0,0] + } + ] + }, + // dUSD-SFG/DF { id: 'DF/USDx', urlParam:'DF-USDx', @@ -572,9 +604,18 @@ class Store { } _getstakedBalance = async (web3, asset, account, callback) => { - let erc20Contract = new web3.eth.Contract(asset.rewardsABI, asset.rewardsAddress) try { - var balance = await erc20Contract.methods.balanceOf(account.address).call({ from: account.address }); + // 判断是 dUSD-SFG/DF 逻辑Str + if(Array.isArray(asset.rewardsSymbol)){ + let erc20Contract_dUSD = new web3.eth.Contract(asset.rewardsABI[1], asset.rewardsAddress[1]) + var balance = await erc20Contract_dUSD.methods.balanceOf(account.address).call({ from: account.address }); + + // 判断是 dUSD-SFG/DF 逻辑End + }else{ + let erc20Contract = new web3.eth.Contract(asset.rewardsABI, asset.rewardsAddress) + var balance = await erc20Contract.methods.balanceOf(account.address).call({ from: account.address }); + } + // balance = parseFloat(balance) / 10 ** asset.decimals callback(null, this.toStringDecimals(balance, asset.decimals)) } catch (ex) { @@ -583,12 +624,35 @@ class Store { } _getRewardsAvailable = async (web3, asset, account, callback) => { - let erc20Contract = new web3.eth.Contract(asset.rewardsABI, asset.rewardsAddress) try { - var earned = await erc20Contract.methods.earned(account.address).call({ from: account.address }); - // earned = parseFloat(earned) / 10 ** asset.decimals - // callback(null, parseFloat(earned)) - callback(null, this.toStringDecimals(earned, 18)) + // 判断是 dUSD-SFG/DF 逻辑Str + if(Array.isArray(asset.rewardsSymbol)){ + // debugger + let SMinter = new web3.eth.Contract(asset.rewardsABI[0], asset.rewardsAddress[0]) + let erc20Contract_SFG = new web3.eth.Contract(asset.rewardsABI[1], asset.rewardsAddress[1]) + let erc20Contract_DF = new web3.eth.Contract(asset.rewardsABI[1], asset.rewardsAddress[1]) + + const rewardsBanlnce = await SMinter.methods.quotas(asset.rewardsAddress[1]).call() + if(rewardsBanlnce !== 0){ + var earnedSFG = await erc20Contract_SFG.methods.claimable_tokens(account.address).call({ from: account.address }); + var earnedDF = await erc20Contract_DF.methods.claimable_reward(account.address).call({ from: account.address }); + // earned = parseFloat(earned) / 10 ** asset.decimals + // callback(null, parseFloat(earned)) + callback(null, [this.toStringDecimals(earnedSFG, 18),this.toStringDecimals(earnedDF, 18)]) + }else{ + // 解决 SFG rewards 收益为 0 时 合约数据溢出bug + var earnedDF = await erc20Contract_DF.methods.claimable_reward(account.address).call({ from: account.address }); + callback(null, [this.toStringDecimals('0', 18),this.toStringDecimals(earnedDF, 18)]) + } + + // 判断是 dUSD-SFG/DF 逻辑End + }else{ + let erc20Contract = new web3.eth.Contract(asset.rewardsABI, asset.rewardsAddress) + var earned = await erc20Contract.methods.earned(account.address).call({ from: account.address }); + // earned = parseFloat(earned) / 10 ** asset.decimals + // callback(null, parseFloat(earned)) + callback(null, this.toStringDecimals(earned, 18)) + } } catch (ex) { return callback(ex) } @@ -640,65 +704,130 @@ class Store { stake = (payload) => { const account = store.getStore('account') const { asset, amount } = payload.content - this._checkApproval(asset, account, amount, asset.rewardsAddress, (err) => { - if (err) { - return emitter.emit(ERROR, err); - } - this._callStake(asset, account, amount, (err, res) => { + // 判断是 dUSD-SFG/DF 逻辑Str + if(Array.isArray(asset.rewardsSymbol)){ + this._checkApproval(asset, account, amount, asset.rewardsAddress[1], (err) => { if (err) { return emitter.emit(ERROR, err); } - - return emitter.emit(STAKE_RETURNED, res) + this._callStake(asset, account, amount, (err, res) => { + if (err) { + return emitter.emit(ERROR, err); + } + + return emitter.emit(STAKE_RETURNED, res) + }) }) - }) + // 判断是 dUSD-SFG/DF 逻辑Str + }else{ + this._checkApproval(asset, account, amount, asset.rewardsAddress, (err) => { + if (err) { + return emitter.emit(ERROR, err); + } + this._callStake(asset, account, amount, (err, res) => { + if (err) { + return emitter.emit(ERROR, err); + } + + return emitter.emit(STAKE_RETURNED, res) + }) + }) + } } _callStake = async (asset, account, amount, callback) => { const web3 = new Web3(store.getStore('web3context').library.provider); - const yCurveFiContract = new web3.eth.Contract(asset.rewardsABI, asset.rewardsAddress) + // 判断是 dUSD-SFG/DF 逻辑Str + if(Array.isArray(asset.rewardsSymbol)){ + const yCurveFiContract = new web3.eth.Contract(asset.rewardsABI[1], asset.rewardsAddress[1]) - var amountToSend = web3.utils.toWei(amount, "ether") - if (asset.decimals != 18) { - amountToSend = (amount * Number(`1e+${asset.decimals}`)).toFixed(0); + var amountToSend = web3.utils.toWei(amount, "ether") + if (asset.decimals != 18) { + amountToSend = (amount * Number(`1e+${asset.decimals}`)).toFixed(0); + + } + // SendTransaction wallet connect - } - // SendTransaction wallet connect - - // let data = yCurveFiContract.methods.stake(amountToSend).encodeABI(); - // let ChainId = await web3.eth.getChainId(); + // let data = yCurveFiContract.methods.stake(amountToSend).encodeABI(); + // let ChainId = await web3.eth.getChainId(); + + // SendTransaction(web3, data, account.address, asset.rewardsAddress, ChainId, amountToSend, callback) + + yCurveFiContract.methods.deposit(amountToSend).send({ from: account.address, gasPrice: web3.utils.toWei(await this._getGasPrice(), 'gwei') }) + .on('transactionHash', function (hash) { + console.log(hash) + callback(null, hash) + }) + .on('confirmation', function (confirmationNumber, receipt) { + if (confirmationNumber == 2) { + dispatcher.dispatch({ type: GET_BALANCES, content: {} }) + } + }) + .on('receipt', function (receipt) { + console.log(receipt); + }) + .on('error', function (error) { + if (!error.toString().includes("-32601")) { + if (error.message) { + return callback(error.message) + } + callback(error) + } + }) + .catch((error) => { + if (!error.toString().includes("-32601")) { + if (error.message) { + return callback(error.message) + } + callback(error) + } + }) + // 判断是 dUSD-SFG/DF 逻辑End + }else{ + const yCurveFiContract = new web3.eth.Contract(asset.rewardsABI, asset.rewardsAddress) - // SendTransaction(web3, data, account.address, asset.rewardsAddress, ChainId, amountToSend, callback) + var amountToSend = web3.utils.toWei(amount, "ether") + if (asset.decimals != 18) { + amountToSend = (amount * Number(`1e+${asset.decimals}`)).toFixed(0); + + } + // SendTransaction wallet connect + + // let data = yCurveFiContract.methods.stake(amountToSend).encodeABI(); + // let ChainId = await web3.eth.getChainId(); + + // SendTransaction(web3, data, account.address, asset.rewardsAddress, ChainId, amountToSend, callback) - yCurveFiContract.methods.stake(amountToSend).send({ from: account.address, gasPrice: web3.utils.toWei(await this._getGasPrice(), 'gwei') }) - .on('transactionHash', function (hash) { - console.log(hash) - callback(null, hash) - }) - .on('confirmation', function (confirmationNumber, receipt) { - if (confirmationNumber == 2) { - dispatcher.dispatch({ type: GET_BALANCES, content: {} }) - } - }) - .on('receipt', function (receipt) { - console.log(receipt); - }) - .on('error', function (error) { - if (!error.toString().includes("-32601")) { - if (error.message) { - return callback(error.message) + yCurveFiContract.methods.stake(amountToSend).send({ from: account.address, gasPrice: web3.utils.toWei(await this._getGasPrice(), 'gwei') }) + .on('transactionHash', function (hash) { + console.log(hash) + callback(null, hash) + }) + .on('confirmation', function (confirmationNumber, receipt) { + if (confirmationNumber == 2) { + dispatcher.dispatch({ type: GET_BALANCES, content: {} }) } - callback(error) - } - }) - .catch((error) => { - if (!error.toString().includes("-32601")) { - if (error.message) { - return callback(error.message) + }) + .on('receipt', function (receipt) { + console.log(receipt); + }) + .on('error', function (error) { + if (!error.toString().includes("-32601")) { + if (error.message) { + return callback(error.message) + } + callback(error) } - callback(error) - } - }) + }) + .catch((error) => { + if (!error.toString().includes("-32601")) { + if (error.message) { + return callback(error.message) + } + callback(error) + } + }) + } } withdraw = (payload) => { @@ -716,8 +845,47 @@ class Store { _callWithdraw = async (asset, account, amount, callback) => { const web3 = new Web3(store.getStore('web3context').library.provider); + // 判断是 dUSD-SFG/DF 逻辑Str + if(Array.isArray(asset.rewardsSymbol)){ + const yCurveFiContract = new web3.eth.Contract(asset.rewardsABI[1], asset.rewardsAddress[1]) - const yCurveFiContract = new web3.eth.Contract(asset.rewardsABI, asset.rewardsAddress) + var amountToSend = web3.utils.toWei(amount, "ether") + if (asset.decimals != 18) { + amountToSend = (amount * 10 ** asset.decimals).toFixed(0); + } + + yCurveFiContract.methods.withdraw(amountToSend,false).send({ from: account.address, gasPrice: web3.utils.toWei(await this._getGasPrice(), 'gwei') }) + .on('transactionHash', function (hash) { + console.log(hash) + callback(null, hash) + }) + .on('confirmation', function (confirmationNumber, receipt) { + if (confirmationNumber == 2) { + dispatcher.dispatch({ type: GET_BALANCES, content: {} }) + } + }) + .on('receipt', function (receipt) { + console.log(receipt); + }) + .on('error', function (error) { + if (!error.toString().includes("-32601")) { + if (error.message) { + return callback(error.message) + } + callback(error) + } + }) + .catch((error) => { + if (!error.toString().includes("-32601")) { + if (error.message) { + return callback(error.message) + } + callback(error) + } + }) + // 判断是 dUSD-SFG/DF 逻辑End + }else{ + const yCurveFiContract = new web3.eth.Contract(asset.rewardsABI, asset.rewardsAddress) var amountToSend = web3.utils.toWei(amount, "ether") if (asset.decimals != 18) { @@ -753,13 +921,14 @@ class Store { callback(error) } }) + } } getReward = (payload) => { const account = store.getStore('account') - const { asset } = payload.content + const { asset,RewardsSymbol } = payload.content - this._callGetReward(asset, account, (err, res) => { + this._callGetReward(asset, RewardsSymbol, account, (err, res) => { if (err) { return emitter.emit(ERROR, err); } @@ -768,12 +937,48 @@ class Store { }) } - _callGetReward = async (asset, account, callback) => { + _callGetReward = async (asset, RewardsSymbol, account, callback) => { const web3 = new Web3(store.getStore('web3context').library.provider); + // 判断是 dUSD-SFG/DF claim SFG 逻辑Str + if(RewardsSymbol === 'SFG'){ + const yCurveFiContract = new web3.eth.Contract(asset.rewardsABI[0], asset.rewardsAddress[0]) - const yCurveFiContract = new web3.eth.Contract(asset.rewardsABI, asset.rewardsAddress) + yCurveFiContract.methods.mint(asset.rewardsAddress[1]).send({ from: account.address, gasPrice: web3.utils.toWei(await this._getGasPrice(), 'gwei') }) + .on('transactionHash', function (hash) { + console.log(hash) + callback(null, hash) + }) + .on('confirmation', function (confirmationNumber, receipt) { + if (confirmationNumber == 2) { + dispatcher.dispatch({ type: GET_BALANCES, content: {} }) + } + }) + .on('receipt', function (receipt) { + console.log(receipt); + }) + .on('error', function (error) { + if (!error.toString().includes("-32601")) { + if (error.message) { + return callback(error.message) + } + callback(error) + } + }) + .catch((error) => { + if (!error.toString().includes("-32601")) { + if (error.message) { + return callback(error.message) + } + callback(error) + } + }) + } + // 判断是 dUSD-SFG/DF claim SFG 逻辑Str + else if(RewardsSymbol === 'DF'){ + // 判断是 dUSD-SFG/DF claim DF 逻辑Str + const yCurveFiContract = new web3.eth.Contract(asset.rewardsABI[1], asset.rewardsAddress[1]) - yCurveFiContract.methods.getReward().send({ from: account.address, gasPrice: web3.utils.toWei(await this._getGasPrice(), 'gwei') }) + yCurveFiContract.methods.claim_rewards().send({ from: account.address, gasPrice: web3.utils.toWei(await this._getGasPrice(), 'gwei') }) .on('transactionHash', function (hash) { console.log(hash) callback(null, hash) @@ -802,6 +1007,40 @@ class Store { callback(error) } }) + // 判断是 dUSD-SFG/DF claim DF 逻辑Str + }else{ + const yCurveFiContract = new web3.eth.Contract(asset.rewardsABI, asset.rewardsAddress) + + yCurveFiContract.methods.getReward().send({ from: account.address, gasPrice: web3.utils.toWei(await this._getGasPrice(), 'gwei') }) + .on('transactionHash', function (hash) { + console.log(hash) + callback(null, hash) + }) + .on('confirmation', function (confirmationNumber, receipt) { + if (confirmationNumber == 2) { + dispatcher.dispatch({ type: GET_BALANCES, content: {} }) + } + }) + .on('receipt', function (receipt) { + console.log(receipt); + }) + .on('error', function (error) { + if (!error.toString().includes("-32601")) { + if (error.message) { + return callback(error.message) + } + callback(error) + } + }) + .catch((error) => { + if (!error.toString().includes("-32601")) { + if (error.message) { + return callback(error.message) + } + callback(error) + } + }) + } } exit = (payload) => { From e591be403676173b6f9f4bb85b5e0388b17faa90 Mon Sep 17 00:00:00 2001 From: skyge <18844062006@163.com> Date: Sun, 25 Oct 2020 09:16:24 +0800 Subject: [PATCH 2/3] A Add new staking contract. --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index aea1fc9..8325cac 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ 0x308777dDEC61F5000D8394626d55dbB0312fe874 - GOLDx-DF Staking + GOLDx-USDx Staking 0xdC7A844a45Ef936497FB916f1c2Ddb80F59a8aDc @@ -35,4 +35,8 @@ dUSDT Staking 0x324EebDAa45829c6A8eE903aFBc7B61AF48538df + + dUSD Staking + 0xD26033b5CEEDce6d8cdDF532c6Cd1eBc2f0ccadf + From d5fd40cd65d10e1bc3f2c722b43dda0806409912 Mon Sep 17 00:00:00 2001 From: gaoyang Date: Tue, 17 Aug 2021 15:02:02 +0800 Subject: [PATCH 3/3] update: disable stake btn --- web-front/src/components/stake/stake.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web-front/src/components/stake/stake.jsx b/web-front/src/components/stake/stake.jsx index 5720705..8c167e2 100644 --- a/web-front/src/components/stake/stake.jsx +++ b/web-front/src/components/stake/stake.jsx @@ -1313,6 +1313,7 @@ class Stake extends Component { (

this.onMaxChange(asset.id, "stake")} + // onClick={() => this.onMaxChange(asset.id, "stake")} >

{ - this.onStake(); + // this.onStake(); }} >