-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add OGNRewardsSource contract * Make collectRewards only callable by RewardsTarget * Draft xOGN staking contract * Correct maxStakeDuration * Add penalty event * Change names * Fix lockup ID * Revert change and cast properly * Gas opts * Remove casting * Add `getLockupsCount` method (#411) * Allow non-duration change amount increase staking extends * Add tests, add move lockupid code * Add Migrator (#410) * Add Migrator contract * Fix some tests * Code review changes * Update OgvStaking tests * Disable delegation tests * Allow just unstakes * Fix comment * More cleanup * Fix brownie tests * Return excess OGN rather than burn * Simplify calculation * Return 0 if uninitialized (#415) * Check available balance in `previewRewards` (#413) * Check available balance in `previewRewards` * Chore: forge fmt --------- Co-authored-by: Daniel Von Fange <[email protected]> * Fix: Remove unused errors (#416) * First draft of deploy file * Add fork test tooling (#419) --------- Co-authored-by: Shahul Hameed <[email protected]>
- Loading branch information
1 parent
ab55599
commit 012b8ab
Showing
33 changed files
with
1,418 additions
and
45 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -16,3 +16,5 @@ out/ | |
.vscode | ||
brownie-deploy/ | ||
.idea | ||
deployments-fork*.json | ||
broadcast/* |
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
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 |
---|---|---|
|
@@ -3,3 +3,7 @@ dependencies: | |
- OpenZeppelin/[email protected] | ||
- OpenZeppelin/[email protected] | ||
- paulrberg/[email protected] | ||
compiler: | ||
solc: | ||
remappings: | ||
- forge-std/=./lib/forge-std/src/ |
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,13 @@ | ||
{ | ||
"1": { | ||
"executions": { | ||
"010_xOGNSetup": 1716312107 | ||
}, | ||
"contracts": { | ||
"OGN_REWARDS_SOURCE": "0x7609c88E5880e934dd3A75bCFef44E31b1Badb8b", | ||
"OGN_REWARDS_SOURCE_IMPL": "0x16890bdd817Ed1c4654430d67329CB20b0B71bB0", | ||
"XOGN": "0x63898b3b6Ef3d39332082178656E9862bee45C57", | ||
"XOGN_IMPL": "0x97711c7a5D64A064a95d10e37f786d2bD8b1F3c8" | ||
} | ||
} | ||
} |
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
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,5 +1,5 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.4; | ||
pragma solidity ^0.8.10; | ||
|
||
import "OpenZeppelin/[email protected]/contracts/governance/TimelockController.sol"; | ||
|
||
|
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,10 @@ | ||
// SPDX-License-Identifier: Unlicense | ||
pragma solidity 0.8.10; | ||
|
||
interface IMintableERC20 { | ||
function mint(address to, uint256 amount) external; | ||
function balanceOf(address owner) external view returns (uint256); | ||
function totalSupply() external view returns (uint256); | ||
function transfer(address to, uint256 amount) external returns (bool); | ||
function approve(address spender, uint256 allowance) external; | ||
} |
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,15 @@ | ||
// SPDX-License-Identifier: Unlicense | ||
pragma solidity 0.8.10; | ||
|
||
interface IOGNGovernance { | ||
function state(uint256 proposalId) external view returns (uint256); | ||
function proposalCount() external view returns (uint256); | ||
function queue(uint256 proposalId) external; | ||
function execute(uint256 proposalId) external; | ||
function propose( | ||
address[] memory targets, | ||
string[] memory signatures, | ||
bytes[] memory calldatas, | ||
string memory description | ||
) external returns (uint256); | ||
} |
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
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,7 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity 0.8.10; | ||
|
||
import {InitializeGovernedUpgradeabilityProxy} from "./InitializeGovernedUpgradeabilityProxy.sol"; | ||
|
||
contract ExponentialStakingProxy is InitializeGovernedUpgradeabilityProxy {} |
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,22 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.10; | ||
|
||
library Addresses { | ||
address public constant TIMELOCK = 0x35918cDE7233F2dD33fA41ae3Cb6aE0e42E0e69F; | ||
address public constant STRATEGIST = 0xF14BBdf064E3F67f51cd9BD646aE3716aD938FDC; | ||
address public constant GOVERNOR_FIVE = 0x3cdD07c16614059e66344a7b579DAB4f9516C0b6; | ||
|
||
address public constant OGN_GOVERNOR = 0x72426BA137DEC62657306b12B1E869d43FeC6eC7; | ||
address public constant GOV_MULTISIG = 0xbe2AB3d3d8F6a32b96414ebbd865dBD276d3d899; | ||
|
||
address public constant INITIAL_DEPLOYER = address(0x1001); | ||
address public constant OGN = 0x8207c1FfC5B6804F6024322CcF34F29c3541Ae26; | ||
address public constant OGV = 0x9c354503C38481a7A7a51629142963F98eCC12D0; | ||
address public constant OGV_REWARDS_PROXY = 0x7d82E86CF1496f9485a8ea04012afeb3C7489397; | ||
address public constant VEOGV = 0x0C4576Ca1c365868E162554AF8e385dc3e7C66D9; | ||
|
||
address public constant OUSD_BUYBACK = 0xD7B28d06365b85933c64E11e639EA0d3bC0e3BaB; | ||
address public constant OETH_BUYBACK = 0xFD6c58850caCF9cCF6e8Aee479BFb4Df14a362D2; | ||
address public constant OUSD_BUYBACK_IMPL = 0x386d8fEC5b6d5B5E36a48A376644e36239dB65d6; | ||
address public constant OETH_BUYBACK_IMPL = 0x4F11d31f781B57051764a3823b24d520626b4833; | ||
} |
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,67 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity 0.8.10; | ||
|
||
import {Vm} from "forge-std/Vm.sol"; | ||
import {Addresses} from "contracts/utils/Addresses.sol"; | ||
import "forge-std/console.sol"; | ||
|
||
import "OpenZeppelin/[email protected]/contracts/utils/Strings.sol"; | ||
|
||
library GovFive { | ||
struct GovFiveAction { | ||
address receiver; | ||
string fullsig; | ||
bytes data; | ||
} | ||
|
||
struct GovFiveProposal { | ||
string name; | ||
string description; | ||
GovFiveAction[] actions; | ||
} | ||
|
||
function setName(GovFiveProposal storage prop, string memory name) internal { | ||
prop.name = name; | ||
} | ||
|
||
function setDescription(GovFiveProposal storage prop, string memory description) internal { | ||
prop.description = description; | ||
} | ||
|
||
function action(GovFiveProposal storage prop, address receiver, string memory fullsig, bytes memory data) | ||
internal | ||
{ | ||
prop.actions.push(GovFiveAction({receiver: receiver, fullsig: fullsig, data: data})); | ||
} | ||
|
||
function printTxData(GovFiveProposal storage prop) internal { | ||
console.log("-----------------------------------"); | ||
console.log("Create following tx on Gnosis safe:"); | ||
console.log("-----------------------------------"); | ||
for (uint256 i = 0; i < prop.actions.length; i++) { | ||
GovFiveAction memory propAction = prop.actions[i]; | ||
bytes memory sig = abi.encodePacked(bytes4(keccak256(bytes(propAction.fullsig)))); | ||
|
||
console.log("### Tx", i + 1); | ||
console.log("Address:", propAction.receiver); | ||
console.log("Data:"); | ||
console.logBytes(abi.encodePacked(sig, propAction.data)); | ||
} | ||
} | ||
|
||
function execute(GovFiveProposal storage prop) internal { | ||
address VM_ADDRESS = address(uint160(uint256(keccak256("hevm cheat code")))); | ||
Vm vm = Vm(VM_ADDRESS); | ||
for (uint256 i = 0; i < prop.actions.length; i++) { | ||
GovFiveAction memory propAction = prop.actions[i]; | ||
bytes memory sig = abi.encodePacked(bytes4(keccak256(bytes(propAction.fullsig)))); | ||
vm.prank(Addresses.TIMELOCK); | ||
(bool success, bytes memory data) = propAction.receiver.call(abi.encodePacked(sig, propAction.data)); | ||
if (!success) { | ||
console.log(propAction.fullsig); | ||
revert("Multisig action failed"); | ||
} | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -3,9 +3,15 @@ src = 'contracts' | |
test = 'tests' | ||
remappings = [ | ||
"contracts/=./contracts", | ||
"script/=./script", | ||
"tests/=./tests", | ||
"OpenZeppelin/openzeppelin-contracts@02fcc75bb7f35376c22def91b0fb9bc7a50b9458/=./lib/openzeppelin-contracts", | ||
"OpenZeppelin/openzeppelin-contracts-upgradeable@a16f26a063cd018c4c986832c3df332a131f53b9/=./lib/openzeppelin-contracts-upgradeable", | ||
"OpenZeppelin/[email protected]/=./lib/openzeppelin-contracts", | ||
"OpenZeppelin/[email protected]/=./lib/openzeppelin-contracts-upgradeable", | ||
"paulrberg/[email protected]/=./lib/prb-math" | ||
] | ||
fs_permissions = [{ access = "read-write", path = "./build"}] | ||
extra_output_files = [ | ||
"metadata" | ||
] |
Submodule forge-std
updated
63 files
Oops, something went wrong.