From 201f5a6daf5960f4cbf99ab9145330a5289e7a28 Mon Sep 17 00:00:00 2001 From: alexcos20 Date: Sat, 22 Oct 2022 04:07:43 -0700 Subject: [PATCH] update feeEstimate & release --- .bumpversion.cfg | 2 +- addresses/address.json | 4 ++-- contracts/ve/veFeeEstimate.vy | 33 ++++++++++++++++++++------------ package.json | 2 +- scripts/deploy-contracts.js | 8 ++++++-- scripts/deploy_ve_feeEstimate.js | 1 + setup.cfg | 2 +- 7 files changed, 33 insertions(+), 19 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 403abd18..fff630bb 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = v1.1.7 +current_version = v1.1.8 commit = True tag = True diff --git a/addresses/address.json b/addresses/address.json index 0750e8a9..dc81c48d 100644 --- a/addresses/address.json +++ b/addresses/address.json @@ -154,7 +154,7 @@ "veDelegation": "0xc768eDF2d21fe00ef5804A7Caa775E877e65A70E", "veFeeDistributor": "0x256c54219816603BB8327F9019533B020a76e936", "veDelegationProxy": "0x45E3BEc7D139Cd8Ed7FeB161F3B094688ddB0c20", - "veFeeEstimate": "0xe97a787420eD263583689Bd35B7Db1952A94710d", + "veFeeEstimate": "0x4aA261bC595abC6fDEf0255C83e2a9305261753f", "SmartWalletChecker": "0xd7ddf62257A41cc6cdAd7A3d36e4f1d925fD142a" }, "goerli": { @@ -219,4 +219,4 @@ "Dispenser": "0x8c98ea273bA22327F896Aa1a1a46E1BFf56e9b1D", "ERC721Factory": "0x49E35cd2bAE043Abd9074B6e5a649a5AdEB05C33" } -} +} \ No newline at end of file diff --git a/contracts/ve/veFeeEstimate.vy b/contracts/ve/veFeeEstimate.vy index 0fd82581..7e08b099 100644 --- a/contracts/ve/veFeeEstimate.vy +++ b/contracts/ve/veFeeEstimate.vy @@ -84,24 +84,15 @@ def _find_timestamp_user_epoch(ve: address, user: address, _timestamp: uint256, _max = _mid - 1 return _min - - -@external +@internal @view -def estimateClaim(addr: address) -> uint256: +def _estimateClaim(addr: address) -> uint256: # Minimal user_epoch is 0 (if user had no point) user_epoch: uint256 = 0 to_distribute: uint256 = 0 _last_token_time: uint256 = FeeDistributor(self.fee_distributor).last_token_time() max_user_epoch: uint256 = VotingEscrow(self.voting_escrow).user_point_epoch(addr) _start_time: uint256 = FeeDistributor(self.fee_distributor).start_time() - - # if checkpoints are missing, them we cannot have an accurate estimate - # veFeeDistributor can do the checks, but requires tx and not just some call functions - if block.timestamp >= FeeDistributor(self.fee_distributor).time_cursor(): - raise("Call checkpoint function") - if block.timestamp > _last_token_time + TOKEN_CHECKPOINT_DEADLINE: - raise("Call checkpoint function") # Round down to weeks _last_token_time = _last_token_time / WEEK * WEEK @@ -161,4 +152,22 @@ def estimateClaim(addr: address) -> uint256: week_cursor += WEEK - return to_distribute \ No newline at end of file + return to_distribute + +@external +@view +def estimateClaimAcc(addr: address) -> uint256: + _last_token_time: uint256 = FeeDistributor(self.fee_distributor).last_token_time() + # if checkpoints are missing, them we cannot have an accurate estimate + # veFeeDistributor can do the checks, but requires tx and not just some call functions + if block.timestamp >= FeeDistributor(self.fee_distributor).time_cursor(): + raise("Call checkpoint function") + if block.timestamp > _last_token_time + TOKEN_CHECKPOINT_DEADLINE: + raise("Call checkpoint function") + + return self._estimateClaim(addr) + +@external +@view +def estimateClaim(addr: address) -> uint256: + return self._estimateClaim(addr) \ No newline at end of file diff --git a/package.json b/package.json index 76c082e9..f142c2e5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@oceanprotocol/contracts", - "version": "v1.1.7", + "version": "v1.1.8", "description": "Ocean Protocol Smartcontracts", "bugs": { "url": "https://github.com/oceanprotocol/contracts/issues" diff --git a/scripts/deploy-contracts.js b/scripts/deploy-contracts.js index 803befbc..27847fa4 100644 --- a/scripts/deploy-contracts.js +++ b/scripts/deploy-contracts.js @@ -71,8 +71,12 @@ async function main() { routerOwner = OPFOwner; OceanTokenAddress = "0x967da4048cD07aB37855c090aAF366e4ce1b9F48"; additionalApprovedTokens = ["0x0642026E7f0B6cCaC5925b4E7Fa61384250e1701"]; - gasPrice = ethers.utils.parseUnits('40', 'gwei') - sleepAmount = 30 + gasPrice = ethers.utils.parseUnits('12', 'gwei') + sleepAmount = 10 + shouldDeployV4 = false; + shouldDeployDF = true; + shouldDeployVE = true; + shouldDeployOPFCommunityFeeCollector = false; break; case 0x3: networkName = "ropsten"; diff --git a/scripts/deploy_ve_feeEstimate.js b/scripts/deploy_ve_feeEstimate.js index dda7d3a3..96676eab 100644 --- a/scripts/deploy_ve_feeEstimate.js +++ b/scripts/deploy_ve_feeEstimate.js @@ -50,6 +50,7 @@ async function main() { OPFOwner = "0x7DF5273aD9A6fCce64D45c64c1E43cfb6F861725"; routerOwner = OPFOwner; OceanTokenAddress = "0x967da4048cD07aB37855c090aAF366e4ce1b9F48"; + gasPrice = ethers.utils.parseUnits('25', 'gwei') break; case 0x3: networkName = "ropsten"; diff --git a/setup.cfg b/setup.cfg index 7cd6c750..0d999a33 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = ocean-contracts -version = v1.1.7 +version = v1.1.8 author = leucothia author_email = devops@oceanprotocol.com description = 🐳 Ocean Protocol L1 - v4