-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from 1inch/feature/oz_5
[SC-989][SC-990] Feature/oz 5
- Loading branch information
Showing
14 changed files
with
1,605 additions
and
746 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
module.exports = { | ||
configureYulOptimizer: true, | ||
solcOptimizerDetails: { | ||
yul: true, | ||
yulDetails: { | ||
optimizerSteps: | ||
'dhfoDgvlfnTUtnIf' + // None of these can make stack problems worse | ||
'[' + | ||
'xa[r]EscLM' + // Turn into SSA and simplify | ||
'cCTUtTOntnfDIl' + // Perform structural simplification | ||
'Lcl' + // Simplify again | ||
'Vcl [j]' + // Reverse SSA | ||
|
||
// should have good 'compilability' property here. | ||
|
||
'Tpel' + // Run functional expression inliner | ||
'xa[rl]' + // Prune a bit more in SSA | ||
'xa[r]cL' + // Turn into SSA again and simplify | ||
'gvf' + // Run full inliner | ||
'CTUca[r]LSsTFOtfDnca[r]Ilc' + // SSA plus simplify | ||
']' + | ||
'jml[jl] VcTOcl jml : fDnTOcm', // Make source short and pretty | ||
}, | ||
}, | ||
skipFiles: [ | ||
'mocks', 'tests', 'interfaces', | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"solidity.compileUsingRemoteVersion": "0.8.19" | ||
"solidity.compileUsingRemoteVersion": "0.8.23" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity 0.8.19; | ||
pragma solidity 0.8.23; | ||
|
||
import "@1inch/farming/contracts/FarmingPlugin.sol"; | ||
import "./interfaces/ISt1inch.sol"; | ||
|
||
contract StakingFarmingPlugin is FarmingPlugin { | ||
using SafeERC20 for IERC20; | ||
|
||
ISt1inch public immutable st1inch; | ||
ISt1inch public immutable ST1INCH; | ||
|
||
constructor(ISt1inch st1inch_) FarmingPlugin(st1inch_, st1inch_.oneInch()) { | ||
st1inch = st1inch_; | ||
constructor(ISt1inch st1inch_, address owner_) FarmingPlugin(st1inch_, st1inch_.ONE_INCH(), owner_) { | ||
ST1INCH = st1inch_; | ||
} | ||
|
||
function _transferReward(IERC20 reward, address to, uint256 amount) internal override { | ||
if (st1inch.emergencyExit()) { | ||
if (ST1INCH.emergencyExit()) { | ||
reward.safeTransfer(to, amount); | ||
} else { | ||
st1inch.depositFor(to, amount); | ||
ST1INCH.depositFor(to, amount); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.