-
Notifications
You must be signed in to change notification settings - Fork 33
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 #1533 from Badger-Finance/feat/restitution2.0
Feat/restitution2.0
- Loading branch information
Showing
6 changed files
with
145 additions
and
40 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
...ade_remBadger_2_0/0xa70e564d8e6c4bbc5612ece25c89a557fea4e70ff424d414e340be8eb76408bb.json
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 @@ | ||
{ | ||
"data": "0000000000000000000000006af7377b5009d7d154f36fe9e235ae1da27aea22000000000000000000000000eeff9a69febaeae39883dbea1eb12db367b97120", | ||
"eta": 1715651201, | ||
"eth": 0, | ||
"signature": "upgrade(address,address)", | ||
"target": "0x20Dce41Acca85E8222D6861Aa6D23B6C941777bF" | ||
} |
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 @@ | ||
def approx(actual, expected, percentage_threshold): | ||
print(actual, expected, percentage_threshold) | ||
diff = int(abs(actual - expected)) | ||
# 0 diff should automtically be a match | ||
if diff == 0: | ||
return True | ||
return diff < (actual * percentage_threshold // 100) |
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,68 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
// !! THIS FILE WAS AUTOGENERATED BY abi-to-sol v0.8.0. SEE SOURCE BELOW. !! | ||
pragma solidity ^0.8.20; | ||
|
||
interface IbremBadger { | ||
error AddressEmptyCode(address target); | ||
error AddressInsufficientBalance(address account); | ||
error ERC1967InvalidImplementation(address implementation); | ||
error ERC1967NonPayable(); | ||
error FailedInnerCall(); | ||
error InvalidInitialization(); | ||
error NotInitializing(); | ||
error ReentrancyGuardReentrantCall(); | ||
error SafeERC20FailedOperation(address token); | ||
error UUPSUnauthorizedCallContext(); | ||
error UUPSUnsupportedProxiableUUID(bytes32 slot); | ||
event DepositsDisabled(); | ||
event DepositsEnabled(uint256 start, uint256 end); | ||
event Initialized(uint64 version); | ||
event Terminated(); | ||
event Upgraded(address indexed implementation); | ||
|
||
function ADMIN() external view returns (address); | ||
|
||
function DEPOSIT_PERIOD_IN_SECONDS() external view returns (uint256); | ||
|
||
function ONE_WEEK_IN_SECONDS() external view returns (uint256); | ||
|
||
function OWNER() external view returns (address); | ||
|
||
function REM_BADGER_TOKEN() external view returns (address); | ||
|
||
function UNLOCK_TIMESTAMP() external view returns (uint256); | ||
|
||
function UPGRADE_INTERFACE_VERSION() external view returns (string memory); | ||
|
||
function VESTING_WEEKS() external view returns (uint256); | ||
|
||
function deposit(uint256 _amount) external; | ||
|
||
function depositEnd() external view returns (uint256); | ||
|
||
function depositStart() external view returns (uint256); | ||
|
||
function disableDeposits() external; | ||
|
||
function enableDeposits() external; | ||
|
||
function initialize() external; | ||
|
||
function proxiableUUID() external view returns (bytes32); | ||
|
||
function terminate() external; | ||
|
||
function terminated() external view returns (bool); | ||
|
||
function totalClaimed(address) external view returns (uint256); | ||
|
||
function totalDeposited(address) external view returns (uint256); | ||
|
||
function upgradeToAndCall(address newImplementation, bytes memory data) | ||
external | ||
payable; | ||
|
||
function vestedAmount(address _depositor) external view returns (uint256); | ||
|
||
function withdrawAll() 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,26 @@ | ||
from helpers.addresses import r | ||
from brownie import interface, chain | ||
from great_ape_safe import GreatApeSafe | ||
|
||
TECHOPS = r.badger_wallets.techops_multisig | ||
BREMBADGER = r.brembadger | ||
|
||
|
||
def enable_deposits(): | ||
safe = GreatApeSafe(TECHOPS) | ||
|
||
brembadger = safe.contract(BREMBADGER, interface.IbremBadger) | ||
brembadger.enableDeposits() | ||
assert brembadger.depositStart() == chain.time() | ||
|
||
safe.post_safe_tx() | ||
|
||
|
||
def disable_deposits(): | ||
safe = GreatApeSafe(TECHOPS) | ||
|
||
brembadger = safe.contract(BREMBADGER, interface.IbremBadger) | ||
brembadger.disableDeposits() | ||
assert brembadger.depositEnd() == chain.time() | ||
|
||
safe.post_safe_tx() |
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