Skip to content

Commit

Permalink
Use networks from solidity-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
zZoMROT committed Dec 18, 2023
1 parent 1e8279f commit d741546
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 338 deletions.
2 changes: 1 addition & 1 deletion contracts/DelegationPlugin.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ contract DelegationPlugin is IDelegationPlugin, Plugin, ERC20 {
if (prevDelegatee != delegatee) {
delegated[msg.sender] = delegatee;
emit Delegated(msg.sender, delegatee);
uint256 balance = IERC20Plugins(token).pluginBalanceOf(address(this), msg.sender);
uint256 balance = IERC20Plugins(TOKEN).pluginBalanceOf(address(this), msg.sender);
if (balance > 0) {
_updateBalances(msg.sender, msg.sender, prevDelegatee, delegatee, balance);
}
Expand Down
4 changes: 2 additions & 2 deletions contracts/FarmingDelegationPlugin.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ contract FarmingDelegationPlugin is IFarmingDelegationPlugin, TokenizedDelegatio

function register(string memory name_, string memory symbol_) public override(ITokenizedDelegationPlugin, TokenizedDelegationPlugin) returns(IDelegatedShare shareToken) {
shareToken = super.register(name_, symbol_);
MultiFarmingPlugin farm = new MultiFarmingPlugin(shareToken, _MAX_FARM_REWARDS);
MultiFarmingPlugin farm = new MultiFarmingPlugin(shareToken, _MAX_FARM_REWARDS, address(this));
farm.transferOwnership(msg.sender);
defaultFarms[msg.sender] = address(farm);
}
Expand All @@ -35,7 +35,7 @@ contract FarmingDelegationPlugin is IFarmingDelegationPlugin, TokenizedDelegatio
}

function setDefaultFarm(address farm) external onlyRegistered {
if (farm != address(0) && IPlugin(farm).token() != registration[msg.sender]) revert DefaultFarmTokenMismatch();
if (farm != address(0) && IPlugin(farm).TOKEN() != registration[msg.sender]) revert DefaultFarmTokenMismatch();
defaultFarms[msg.sender] = farm;
emit DefaultFarmSet(farm);
}
Expand Down
4 changes: 3 additions & 1 deletion hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ require('hardhat-deploy');
require('hardhat-tracer');
require('hardhat-gas-reporter');
require('dotenv').config();
const { Networks, getNetwork } = require('@1inch/solidity-utils/hardhat-setup');

const { networks, etherscan } = require('./hardhat.networks');
const { networks, etherscan } = (new Networks()).registerAll();

module.exports = {
etherscan,
Expand All @@ -19,6 +20,7 @@ module.exports = {
enabled: true,
runs: 1000000,
},
evmVersion: networks[getNetwork()]?.hardfork || 'shanghai',
viaIR: true,
},
},
Expand Down
88 changes: 0 additions & 88 deletions hardhat.networks.js

This file was deleted.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
},
"license": "MIT",
"dependencies": {
"@1inch/token-plugins": "git+https://github.com/1inch/token-plugins.git#4d113410faedfbd385df6c99a4481e3e0d001e08",
"@1inch/farming": "git+https://github.com/1inch/farming.git#d140c9a39ed46eb6dbef9c4970b40c5528233c53",
"@1inch/solidity-utils": "3.5.4",
"@1inch/token-plugins": "https://github.com/1inch/token-plugins.git#feature/bump-solidity",
"@1inch/farming": "https://github.com/1inch/farming.git#feature/bump-solidity",
"@1inch/solidity-utils": "3.5.5",
"@openzeppelin/contracts": "5.0.1",
"hardhat-dependency-compiler": "1.1.3"
},
Expand Down
Loading

0 comments on commit d741546

Please sign in to comment.