523 lines
30 KiB
Solidity
523 lines
30 KiB
Solidity
pragma solidity 0.8.20;
|
|
|
|
import {Test} from "forge-std/Test.sol";
|
|
|
|
import {Gatekeeper} from "../../src/Gatekeeper.sol";
|
|
import {FullMath} from "../../src/libraries/FullMath.sol";
|
|
import {GhostPacking} from "../../src/libraries/Packing.sol";
|
|
import {IStorageHistory} from "../../src/interfaces/IStorageHistory.sol";
|
|
import {StorageHistory} from "../../src/types/StorageHistory.sol";
|
|
import {WETH9} from "../../src/mocks/WETH9.sol";
|
|
|
|
contract MockGovernance is Test {
|
|
address public immutable GATEKEEPER;
|
|
address public immutable DUMMY_ADDRESS;
|
|
|
|
bool public auditCalled;
|
|
|
|
enum STATUS {
|
|
RESERVEDEPOSITOR,
|
|
RESERVETOKEN,
|
|
LIQUIDITYDEPOSITOR,
|
|
LIQUIDITYTOKEN,
|
|
REWARDMANAGER
|
|
}
|
|
|
|
constructor(address gatekeeper, address dummyAddress) {
|
|
GATEKEEPER = gatekeeper;
|
|
DUMMY_ADDRESS = dummyAddress;
|
|
auditCalled = false;
|
|
}
|
|
|
|
function setDistributor(address distributor) external view {
|
|
require(msg.sender == GATEKEEPER);
|
|
assertEq(distributor, DUMMY_ADDRESS);
|
|
}
|
|
|
|
function setWarmupPeriod(uint256 warmupPeriod) external view {
|
|
require(msg.sender == GATEKEEPER);
|
|
assertEq(warmupPeriod, 69);
|
|
}
|
|
|
|
function setBounty(uint256 bounty) external view {
|
|
require(msg.sender == GATEKEEPER);
|
|
assertEq(bounty, 69);
|
|
}
|
|
|
|
function setAdjustment(uint256 rate, uint256 target, bool add) external view {
|
|
require(msg.sender == GATEKEEPER);
|
|
assertEq(rate, 69);
|
|
assertEq(target, 420);
|
|
assertEq(add, true);
|
|
}
|
|
|
|
function updateGatekeeperAddress(address gatekeeper) external view {
|
|
require(msg.sender == GATEKEEPER);
|
|
assertEq(gatekeeper, DUMMY_ADDRESS);
|
|
}
|
|
|
|
function addPool(address pool) external view {
|
|
require(msg.sender == GATEKEEPER);
|
|
assertEq(pool, DUMMY_ADDRESS);
|
|
}
|
|
|
|
function removePool(uint256 index) external view {
|
|
require(msg.sender == GATEKEEPER);
|
|
assertEq(index, 1337);
|
|
}
|
|
|
|
function close(uint256 id) external view {
|
|
require(msg.sender == GATEKEEPER);
|
|
assertEq(id, 420);
|
|
}
|
|
|
|
function create(
|
|
uint256[4] calldata market,
|
|
uint256[2] calldata terms,
|
|
address quoteToken,
|
|
uint32[2] calldata intervals,
|
|
bool[2] calldata booleans
|
|
) external view {
|
|
require(msg.sender == GATEKEEPER);
|
|
|
|
assertEq(market[0], 69);
|
|
assertEq(market[1], 420);
|
|
assertEq(market[2], 1337);
|
|
assertEq(market[3], 0);
|
|
|
|
assertEq(terms[0], 420);
|
|
assertEq(terms[1], 1337);
|
|
|
|
assertEq(quoteToken, DUMMY_ADDRESS);
|
|
|
|
assertEq(intervals[0], 34);
|
|
assertEq(intervals[1], 35);
|
|
|
|
assertEq(booleans[0], true);
|
|
assertEq(booleans[1], true);
|
|
}
|
|
|
|
function enable(STATUS status, address token, address calculator) external view {
|
|
require(msg.sender == GATEKEEPER);
|
|
|
|
if (status != STATUS.RESERVETOKEN) revert();
|
|
assertEq(token, DUMMY_ADDRESS);
|
|
assertEq(calculator, DUMMY_ADDRESS);
|
|
}
|
|
|
|
function disable(STATUS status, address token) external view {
|
|
require(msg.sender == GATEKEEPER);
|
|
|
|
if (status != STATUS.LIQUIDITYTOKEN) revert();
|
|
assertEq(token, DUMMY_ADDRESS);
|
|
}
|
|
|
|
function forfeitReserves(address router, uint256 liquidity, bool destroyerMode) external view {
|
|
require(msg.sender == GATEKEEPER);
|
|
assertEq(router, DUMMY_ADDRESS);
|
|
assertEq(liquidity, 420);
|
|
assertEq(destroyerMode, true);
|
|
}
|
|
|
|
function redeemReserve(address router, uint256 amount) external view {
|
|
require(msg.sender == GATEKEEPER);
|
|
assertEq(router, DUMMY_ADDRESS);
|
|
assertEq(amount, 420);
|
|
}
|
|
|
|
function withdraw(address token, uint256 amount) external view {
|
|
require(msg.sender == GATEKEEPER);
|
|
assertEq(token, DUMMY_ADDRESS);
|
|
assertEq(amount, 420);
|
|
}
|
|
|
|
function auditReserves() external {
|
|
require(msg.sender == GATEKEEPER);
|
|
auditCalled = true;
|
|
}
|
|
}
|
|
|
|
contract MockStaking is Test {
|
|
Gatekeeper public gatekeeper;
|
|
WETH9 public mockReserve;
|
|
|
|
mapping(address => uint256) private _recalledAmounts;
|
|
mapping(address => uint256) private _phantomedAmounts;
|
|
|
|
constructor() {
|
|
mockReserve = new WETH9();
|
|
StorageHistory history = new StorageHistory();
|
|
gatekeeper = new Gatekeeper(address(history), address(this));
|
|
gatekeeper.initialize(address(0));
|
|
history.setOwner(address(gatekeeper));
|
|
}
|
|
|
|
function runGhost(bytes32 receiver, uint256 amount) external {
|
|
gatekeeper.ghost(receiver, amount);
|
|
}
|
|
|
|
function runRecall(
|
|
uint256 exodusSession,
|
|
uint256 amount,
|
|
uint256 packed,
|
|
address caller
|
|
) external {
|
|
vm.prank(address(gatekeeper), caller);
|
|
gatekeeper.recall(exodusSession, amount, packed);
|
|
}
|
|
|
|
function recall(address receiver, uint256 amount) external {
|
|
_recalledAmounts[receiver] += amount;
|
|
}
|
|
|
|
function recall(uint256 amount, uint256) external returns (address, uint256){
|
|
_recalledAmounts[tx.origin] += amount;
|
|
return (address(mockReserve), 0);
|
|
}
|
|
|
|
function phantomRefund(address who, uint256 amount) external {
|
|
_phantomedAmounts[who] += amount;
|
|
}
|
|
|
|
function recalledAmount(address who) external view returns (uint256) {
|
|
return _recalledAmounts[who];
|
|
}
|
|
|
|
function totalReserves() external pure returns (uint256) {
|
|
return type(uint256).max;
|
|
}
|
|
|
|
function baseSupply() external pure returns (uint256) {
|
|
return type(uint256).max;
|
|
}
|
|
}
|
|
|
|
contract GatekeeperTest is Test {
|
|
using GhostPacking for GhostPacking.RequestPayload;
|
|
|
|
address constant ALICE = 0x0000000000000000000000000000000000000001;
|
|
address constant BOB = 0x0000000000000000000000000000000000000002;
|
|
uint256 constant INIT_AMOUNT = 69 * 1e18;
|
|
address constant DUMMY_ADDRESS = address(0x0101010101010101010101010101010101010101);
|
|
|
|
MockGovernance governance;
|
|
Gatekeeper gatekeeper;
|
|
MockStaking staking;
|
|
|
|
event ThreadInserted(uint256 index, uint256 session);
|
|
|
|
function setUp() public {
|
|
vm.prank(ALICE, ALICE);
|
|
staking = new MockStaking();
|
|
gatekeeper = staking.gatekeeper();
|
|
|
|
MockGovernance tempGov = new MockGovernance(address(gatekeeper), DUMMY_ADDRESS);
|
|
bytes memory govBytecode = address(tempGov).code;
|
|
|
|
vm.etch(DUMMY_ADDRESS, govBytecode);
|
|
governance = MockGovernance(DUMMY_ADDRESS);
|
|
}
|
|
|
|
function test_correctInitialization() public view {
|
|
assertEq(gatekeeper.staking(), address(staking));
|
|
assertEq(gatekeeper.ghostedSupply(), 0);
|
|
}
|
|
|
|
function test_ghostTokensWork(uint256 ghostAmount) public {
|
|
vm.assume(ghostAmount >= gatekeeper.EXISTENTIAL_DEPOSIT() && ghostAmount < type(uint96).max);
|
|
bytes32 receiver = bytes32(abi.encodePacked(ALICE));
|
|
uint256 ghostedSupply = gatekeeper.ghostedSupply();
|
|
|
|
vm.prank(ALICE);
|
|
staking.runGhost(receiver, ghostAmount);
|
|
assertEq(gatekeeper.ghostedSupply(), ghostedSupply + ghostAmount);
|
|
}
|
|
|
|
function test_couldNotGhostTokensFromArbitraryAddress(address someone) public {
|
|
vm.assume(someone != ALICE);
|
|
bytes32 receiver = bytes32(abi.encodePacked(ALICE));
|
|
|
|
vm.expectRevert();
|
|
vm.prank(someone);
|
|
staking.runGhost(receiver, 69);
|
|
assertEq(gatekeeper.ghostedSupply(), 0);
|
|
}
|
|
|
|
function test_ghostTokensEmitsEvent(uint256 ghostAmount) public {
|
|
vm.assume(ghostAmount >= gatekeeper.EXISTENTIAL_DEPOSIT());
|
|
bytes32 receiver = bytes32(abi.encodePacked(ALICE));
|
|
|
|
vm.expectEmit(true, true, true, false, address(gatekeeper));
|
|
emit ThreadInserted(0, 0);
|
|
vm.prank(ALICE);
|
|
staking.runGhost(receiver, ghostAmount);
|
|
}
|
|
|
|
function test_recallWork(uint256 exodusSession, uint256 bobAmount, uint32 bobCommission) public {
|
|
vm.assume(bobAmount > gatekeeper.EXISTENTIAL_DEPOSIT() && bobAmount < 1_000 ether);
|
|
vm.assume(bobCommission > 0 && bobCommission <= type(uint32).max);
|
|
|
|
address storageHistory = gatekeeper.storageHistory();
|
|
uint256 commissionAmount = FullMath.mulDiv(bobAmount, uint256(bobCommission), type(uint32).max);
|
|
uint256 bobPacked = GhostPacking.pack(uint32(bobCommission), uint64(block.chainid), BOB);
|
|
|
|
vm.prank(ALICE);
|
|
staking.runGhost(bytes32(abi.encodePacked(ALICE)), bobAmount);
|
|
|
|
uint256 nativeNeeded = FullMath.mulDiv(commissionAmount, staking.totalReserves(), staking.baseSupply());
|
|
|
|
vm.deal(ALICE, nativeNeeded + 1 ether);
|
|
assertEq(BOB.balance, 0 ether);
|
|
|
|
vm.prank(ALICE);
|
|
staking.runRecall(exodusSession, bobAmount, bobPacked, ALICE);
|
|
|
|
assert(IStorageHistory(storageHistory).isTransactionExecuted(exodusSession));
|
|
}
|
|
|
|
function test_couldNotBridgeBelowExistential(uint256 amount) public {
|
|
vm.assume(amount < gatekeeper.EXISTENTIAL_DEPOSIT());
|
|
bytes32 receiver = bytes32(abi.encodePacked(ALICE));
|
|
|
|
vm.expectRevert();
|
|
vm.prank(ALICE);
|
|
staking.runGhost(receiver, amount);
|
|
|
|
assertEq(gatekeeper.ghostedSupply(), 0);
|
|
}
|
|
|
|
function test_signatureVerificationsWorks() public {
|
|
assertEq(gatekeeper.deployer(), ALICE);
|
|
|
|
vm.prank(ALICE);
|
|
staking.runGhost(bytes32(abi.encodePacked(ALICE)), type(uint104).max);
|
|
|
|
vm.prank(ALICE);
|
|
gatekeeper.updatePublicKeyMetadata(0, 0xa2bc78dbf596f27949ae9a3cc680ce038a4830670b6e458b99424de55a77ca8b);
|
|
|
|
(bytes32 prevPublicKey,) = gatekeeper.latestPublicKeyInfo();
|
|
|
|
// DKG #1 <==> Context ExodusContext { session: 1, network_id: 420 }
|
|
// Inside 31337 we have no transactions yet
|
|
gatekeeper.verify(
|
|
hex"e2528510000000000000000000000000000000000000000000000000000000000000000105d0d43c05e4fb7206614cde8416ed03c8d0b1ad4594fe52c6701d33816c8680123456789abcdef0123456789abcdef020000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000100000000000000000000000000000000",
|
|
0x924713ed07e9d6550db826501bb3a1bc4b1996bd44bd690755ddd0b45e312984,
|
|
0x458afab7a2f65589b71acf9587045d9b899cd4748cf242c0432384878759cc4e
|
|
);
|
|
|
|
(bytes32 publicKey, uint256 session) = gatekeeper.latestPublicKeyInfo();
|
|
assertTrue(publicKey != prevPublicKey);
|
|
assertEq(session, 0);
|
|
|
|
prevPublicKey = publicKey;
|
|
|
|
// Bridge Out - amount: 210; commission: 50%; BOB
|
|
// DKG #3 <==> Context ExodusContext { session: 12, network_id: 31337 }
|
|
vm.prank(ALICE, ALICE);
|
|
vm.expectRevert();
|
|
gatekeeper.verify(
|
|
hex"bf06188a000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000d200000000000000000000000000000000000000020000000000007a6980000000",
|
|
0x998b818c9e56a90dffa61e876e2760f58bf83dcd172b1ec75328a3629b2fa5b1,
|
|
0x2174c7270034b6b1d40e360b054431f41b558ad0389a3848cdba3b42388552a8
|
|
);
|
|
|
|
// DKG #3 <==> Context ExodusContext { session: 1337, network_id: 420 }
|
|
vm.expectRevert();
|
|
gatekeeper.verify(
|
|
hex"e252851000000000000000000000000000000000000000000000000000000000000005396f1587daa198f9a5ed8d301298890d467e51eca3ce978eaba24c034c8797a33d123456789abcdef0123456789abcdef020000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000100000000000000013000000000000053900000000000000000000000000000000",
|
|
0x14d0c7c4f3f517055efa54f15699d25badc113d98e548982bead74f974ba89c7,
|
|
0x53c634179b8cc1880148010d9ced4cd1b1239b7cee60d661f8f16104d74db3e3
|
|
);
|
|
|
|
// DKG #2 <==> Context ExodusContext { session: 11, network_id: 31337 }
|
|
gatekeeper.verify(
|
|
hex"e2528510000000000000000000000000000000000000000000000000000000000000000bd2bfa65ff23d258957b624de498ada8ee31594eec89658dd1f7bb5dbda4db862123456789abcdef0123456789abcdef02000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000010000000000000000b000000000000000200000000000000000000000000000000",
|
|
0x7e758c7ea5588da3cca5c8e0f42aa7b5850ab524338ef644e73bc5cf00e0b1ab,
|
|
0x0ce5ac0022fe8704af938c599333e87585d0620281a705cb474362dcba590a42
|
|
);
|
|
|
|
(publicKey, session) = gatekeeper.latestPublicKeyInfo();
|
|
assertTrue(publicKey != prevPublicKey);
|
|
assertEq(session, 11);
|
|
|
|
prevPublicKey = publicKey;
|
|
|
|
// DKG #3 <==> Context ExodusContext { session: 1337, network_id: 420 }
|
|
// Inside 31337 we have session: 19
|
|
gatekeeper.verify(
|
|
hex"e252851000000000000000000000000000000000000000000000000000000000000005396f1587daa198f9a5ed8d301298890d467e51eca3ce978eaba24c034c8797a33d123456789abcdef0123456789abcdef020000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000100000000000000013000000000000053900000000000000000000000000000000",
|
|
0x14d0c7c4f3f517055efa54f15699d25badc113d98e548982bead74f974ba89c7,
|
|
0x53c634179b8cc1880148010d9ced4cd1b1239b7cee60d661f8f16104d74db3e3
|
|
);
|
|
|
|
(publicKey, session) = gatekeeper.latestPublicKeyInfo();
|
|
assertTrue(publicKey != prevPublicKey);
|
|
assertEq(session, 19);
|
|
|
|
prevPublicKey = publicKey;
|
|
|
|
uint256 aliceAmountBefore = staking.recalledAmount(ALICE);
|
|
uint256 bobAmountBefore = staking.recalledAmount(BOB);
|
|
uint256 aliceBalanceBefore = ALICE.balance;
|
|
uint256 bobBalanceBefore = BOB.balance;
|
|
|
|
// Bridge Out - amount: 34; commission: 0%; ALICE
|
|
// DKG #2 <==> Context ExodusContext { session: 1, network_id: 31337 }
|
|
vm.prank(ALICE, ALICE);
|
|
gatekeeper.verify(
|
|
hex"bf06188a0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002200000000000000000000000000000000000000010000000000007a6900000000",
|
|
0xac8c25886fb6dba968832ee621076986bd7c57eb45448202aa74274ab2c78c16,
|
|
0x4a6c5c8962ef2e27ee7ea23376555c8071e2ef387e237d3ba7d1b172720f5c82
|
|
);
|
|
|
|
assertEq(aliceAmountBefore + 34, staking.recalledAmount(ALICE));
|
|
assertEq(bobAmountBefore, staking.recalledAmount(BOB));
|
|
assertEq(aliceBalanceBefore, ALICE.balance);
|
|
assertEq(bobBalanceBefore, BOB.balance);
|
|
|
|
aliceAmountBefore = staking.recalledAmount(ALICE);
|
|
bobAmountBefore = staking.recalledAmount(BOB);
|
|
aliceBalanceBefore = ALICE.balance;
|
|
bobBalanceBefore = BOB.balance;
|
|
|
|
// Bridge Out - amount: 210; commission: 50%; BOB
|
|
// DKG #3 <==> Context ExodusContext { session: 12, network_id: 31337 }
|
|
vm.prank(ALICE, ALICE);
|
|
gatekeeper.verify(
|
|
hex"bf06188a000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000d200000000000000000000000000000000000000020000000000007a6980000000",
|
|
0x998b818c9e56a90dffa61e876e2760f58bf83dcd172b1ec75328a3629b2fa5b1,
|
|
0x2174c7270034b6b1d40e360b054431f41b558ad0389a3848cdba3b42388552a8
|
|
);
|
|
|
|
assertApproxEqAbs(aliceAmountBefore + 105, staking.recalledAmount(ALICE), 1);
|
|
assertApproxEqAbs(bobAmountBefore + 105, staking.recalledAmount(BOB), 1);
|
|
|
|
// Governance: ExodusRequestType::EvmGovernance { target: 0x0101010101010101010101010101010101010101, action: GovernanceAction::RemovePool { index: 1337 } }
|
|
// DKG #2 <==> Context ExodusContext { session: 8, network_id: 31337 }
|
|
gatekeeper.verify(
|
|
hex"3137142600000000000000000000000000000000000000000000000000000000000000080000000000007a6901010101010101010101010101010101010101010000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000024a38dcbd0000000000000000000000000000000000000000000000000000000000000053900000000000000000000000000000000000000000000000000000000",
|
|
0x32bb624814da6ec2663cb1fdf23bfcfa92c971fdd00be3fdb933bc04e92dfe8e,
|
|
0xd71cec3db4fc72cd269a04831d278a342949bbeed43a034f15662ea7f0bfc81d
|
|
);
|
|
|
|
// Governance: ExodusRequestType::EvmGovernance { target: 0x0101010101010101010101010101010101010101, action: GovernanceAction::AddPool { address: 0x0101010101010101010101010101010101010101 } }
|
|
// DKG #2 <==> Context ExodusContext { session: 7, network_id: 31337 }
|
|
gatekeeper.verify(
|
|
hex"3137142600000000000000000000000000000000000000000000000000000000000000070000000000007a6901010101010101010101010101010101010101010000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000024d914cd4b000000000000000000000000010101010101010101010101010101010101010100000000000000000000000000000000000000000000000000000000",
|
|
0x5c83ff7a2ccf8b9e89a883704403bf9bfe4aeadbee18b6df392b372edef6a915,
|
|
0x498efce0fadd9668199ccdf2161dd2b563217fc38018f214fce8fc6a48fdcd7d
|
|
);
|
|
|
|
// Governance: ExodusRequestType::EvmGovernance { target: 0x0101010101010101010101010101010101010101, action: GovernanceAction::Close { id: 420 } }
|
|
// DKG #2 <==> Context ExodusContext { session: 9, network_id: 31337 }
|
|
gatekeeper.verify(
|
|
hex"3137142600000000000000000000000000000000000000000000000000000000000000090000000000007a69010101010101010101010101010101010101010100000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000240aebeb4e00000000000000000000000000000000000000000000000000000000000001a400000000000000000000000000000000000000000000000000000000",
|
|
0x8692a623d80fe3424d8748616ed3abf854377b5c236866d839bcc7a9fb60befc,
|
|
0xc38505e1b0bcf6e5d6f9f9351d41ca4d79e3ac3934042cdfbefcf4dd141b7d4b
|
|
);
|
|
|
|
// Governance: ExodusRequestType::EvmGovernance { target: 0x0101010101010101010101010101010101010101, action: GovernanceAction::UpdateGatekeeperAddress { new_gatekeeper: 0x0101010101010101010101010101010101010101 } }
|
|
// DKG #2 <==> Context ExodusContext { session: 6, network_id: 31337 }
|
|
gatekeeper.verify(
|
|
hex"3137142600000000000000000000000000000000000000000000000000000000000000060000000000007a690101010101010101010101010101010101010101000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000002484f157cd000000000000000000000000010101010101010101010101010101010101010100000000000000000000000000000000000000000000000000000000",
|
|
0x677993ffdf86b16e33252a11ee458b07cafd6f6466011c8d61ce4d915d4dcfd2,
|
|
0xcace2beda758c827f41ada31a9957f54dde47aa31e019c9b5b07212686eb2b3d
|
|
);
|
|
|
|
// Governance: ExodusRequestType::EvmGovernance { target: 0x0101010101010101010101010101010101010101, action: GovernanceAction::SetAdjustment { rate: 69, target: 420, add: true } }
|
|
// DKG #2 <==> Context ExodusContext { session: 5, network_id: 31337 }
|
|
gatekeeper.verify(
|
|
hex"3137142600000000000000000000000000000000000000000000000000000000000000050000000000007a690101010101010101010101010101010101010101000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000006446d36ab5000000000000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000000000000000000000000001a4000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000",
|
|
0xfab44bf2062ac65187345686d94fb0d750f47eab5e8676b3d0e0b110328a2199,
|
|
0x9989e32112b402a667570ec2717b802fe65902476252296814bc9c7548a6b9f0
|
|
);
|
|
|
|
// Governance: ExodusRequestType::EvmGovernance { target: 0x0101010101010101010101010101010101010101, action: GovernanceAction::Create { market: [69, 420, 1337, 0], terms: [420, 1337], token: 0x0101010101010101010101010101010101010101, intervals: [34, 35], booleans: [true, true] } }
|
|
// DKG #2 <==> Context ExodusContext { session: 10, network_id: 31337 }
|
|
gatekeeper.verify(
|
|
hex"31371426000000000000000000000000000000000000000000000000000000000000000a0000000000007a6901010101010101010101010101010101010101010000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000164206eb0f8000000000000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000000000000000000000000001a40000000000000000000000000000000000000000000000000000000000000539000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001a400000000000000000000000000000000000000000000000000000000000005390000000000000000000000000101010101010101010101010101010101010101000000000000000000000000000000000000000000000000000000000000002200000000000000000000000000000000000000000000000000000000000000230000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000",
|
|
0xa243c6bb2e135b1ee756f2489a968ce56cb27891ff22eca9c26fa3ea35a86486,
|
|
0x65d1db30026bef6cdd3a8b2e9eea23f74cc579f493a78501f2dbefd68ade9d36
|
|
);
|
|
|
|
// Governance: ExodusRequestType::EvmGovernance { target: 0x0101010101010101010101010101010101010101, action: GovernanceAction::SetDistributor { distributor: 0x0101010101010101010101010101010101010101 } }
|
|
// DKG #2 <==> Context ExodusContext { session: 2, network_id: 31337 }
|
|
gatekeeper.verify(
|
|
hex"3137142600000000000000000000000000000000000000000000000000000000000000020000000000007a690101010101010101010101010101010101010101000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000002475619ab5000000000000000000000000010101010101010101010101010101010101010100000000000000000000000000000000000000000000000000000000",
|
|
0x3e4bf03267f4f7137ff09de70c584b131e270b346de78832143ab3ef2345164b,
|
|
0x3c4a2b60c7c0047de00a6821c8983f85e9c639f68c377f0c3588580ad0571ce6
|
|
);
|
|
|
|
// Governance: ExodusRequestType::EvmGovernance { target: 0x0101010101010101010101010101010101010101, action: GovernanceAction::SetBounty { bounty: 69 } }
|
|
// DKG #2 <==> Context ExodusContext { session: 4, network_id: 31337 }
|
|
gatekeeper.verify(
|
|
hex"3137142600000000000000000000000000000000000000000000000000000000000000040000000000007a69010101010101010101010101010101010101010100000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000245d87d363000000000000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000000000000000000000",
|
|
0x975c6199aa814cbdcf870d7b2cfcf2b676c37656ae9b2a78570cea09fd03f235,
|
|
0x0aab05570e567384ee6d143019e692c52ba0e353ee4a5cc99a491161ccf275f4
|
|
);
|
|
|
|
// Governance: ExodusRequestType::EvmGovernance { target: 0x0101010101010101010101010101010101010101, action: GovernanceAction::SetWarmupPeriod { warmup_period: 69 } }
|
|
// DKG #2 <==> Context ExodusContext { session: 3, network_id: 31337 }
|
|
gatekeeper.verify(
|
|
hex"3137142600000000000000000000000000000000000000000000000000000000000000030000000000007a6901010101010101010101010101010101010101010000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000024a85667c5000000000000000000000000000000000000000000000000000000000000004500000000000000000000000000000000000000000000000000000000",
|
|
0x6b244416e4edced7254e685dc33bac209375c7e83e4032de46ea39c430abdbe4,
|
|
0xec45371821d04be6fb82372a42fb750fee1a2e697eb23bfe773d3fc6f569b9f3
|
|
);
|
|
|
|
// Governance: ExodusRequestType::EvmGovernance { target: 0x0101010101010101010101010101010101010101, action: GovernanceAction::AuditReserves }
|
|
// DKG #3 <==> Context ExodusContext { session: 18, network_id: 31337 }
|
|
gatekeeper.verify(
|
|
hex"3137142600000000000000000000000000000000000000000000000000000000000000120000000000007a69010101010101010101010101010101010101010100000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000042b7ce50000000000000000000000000000000000000000000000000000000000",
|
|
0x6bdb0f659b8c8e35ba5d59014ec441a95ba236f0d9da71775f2ac9ed3f04489d,
|
|
0x3ec6f44e57af7143f2b49431c1ae5459f95894bdd758743e0b83f51ab178316c
|
|
);
|
|
|
|
// Governance: ExodusRequestType::EvmGovernance { target: 0x0101010101010101010101010101010101010101, action: GovernanceAction::Disable { status: GovernanceStatus::LiquidityToken, address: 0x0101010101010101010101010101010101010101 } }
|
|
// DKG #3 <==> Context ExodusContext { session: 14, network_id: 31337 }
|
|
gatekeeper.verify(
|
|
hex"31371426000000000000000000000000000000000000000000000000000000000000000e0000000000007a6901010101010101010101010101010101010101010000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044529918310000000000000000000000000000000000000000000000000000000000000003000000000000000000000000010101010101010101010101010101010101010100000000000000000000000000000000000000000000000000000000",
|
|
0x6e02d583a3b870a918f9150c153f79d2f3f653c6461aa0029e54b80ec7b90e42,
|
|
0x778cfdb98bdd083348deeca80840d0f6131c8cc157c6ddd767110b2c2dda98b1
|
|
);
|
|
|
|
// Governance: ExodusRequestType::EvmGovernance { target: 0x0101010101010101010101010101010101010101, action: GovernanceAction::ForfeitReserves { router: 0x0101010101010101010101010101010101010101, liquidity: 420, destroyer_mode: true } }
|
|
// DKG #3 <==> Context ExodusContext { session: 15, network_id: 31337 }
|
|
gatekeeper.verify(
|
|
hex"31371426000000000000000000000000000000000000000000000000000000000000000f0000000000007a6901010101010101010101010101010101010101010000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000064f0de236c000000000000000000000000010101010101010101010101010101010101010100000000000000000000000000000000000000000000000000000000000001a4000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000",
|
|
0x846e864907e7e2d22e51b6dd956d72f9a9a769930d6be9026d023aa654c5e8ba,
|
|
0x2856077b65172e2328bebab57b68329c78e3057f0690ce24dfa9bbe1e49c1fac
|
|
);
|
|
|
|
// Governance: ExodusRequestType::EvmGovernance { target: 0x0101010101010101010101010101010101010101, action: GovernanceAction::Enable { status: GovernanceStatus::ReserveToken, address: 0x0101010101010101010101010101010101010101, calculator: 0x0101010101010101010101010101010101010101 } }
|
|
// DKG #3 <==> Context ExodusContext { session: 13, network_id: 31337 }
|
|
gatekeeper.verify(
|
|
hex"31371426000000000000000000000000000000000000000000000000000000000000000d0000000000007a6901010101010101010101010101010101010101010000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000064e4e33ef800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000101010101010101010101010101010101010101000000000000000000000000010101010101010101010101010101010101010100000000000000000000000000000000000000000000000000000000",
|
|
0x14355ac448e9623a3be2aeaf1a21598e721999a7bb9455d1ef33c8c33a79d615,
|
|
0x5f878532a68f6afba122a7f9dfcef1e75742ddf6c3c194c8794f230fb2cacc05
|
|
);
|
|
|
|
// Governance: ExodusRequestType::EvmGovernance { target: 0x0101010101010101010101010101010101010101, action: GovernanceAction::Withdraw { token: 0x0101010101010101010101010101010101010101, amount: 420 } }
|
|
// DKG #3 <==> Context ExodusContext { session: 17, network_id: 31337 }
|
|
gatekeeper.verify(
|
|
hex"3137142600000000000000000000000000000000000000000000000000000000000000110000000000007a6901010101010101010101010101010101010101010000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044f3fef3a3000000000000000000000000010101010101010101010101010101010101010100000000000000000000000000000000000000000000000000000000000001a400000000000000000000000000000000000000000000000000000000",
|
|
0xee3e0d737fa9447afec930b1be323c930355d1dcfa57a05d80dc57d0434770b4,
|
|
0xca1a8f1c03287fcdaad37166cc1c3e7ae001c521e10f855c8d43ea783e5e9bea
|
|
);
|
|
|
|
// Governance: ExodusRequestType::EvmGovernance { target: 0x0101010101010101010101010101010101010101, action: GovernanceAction::RedeemReserves { router: 0x0101010101010101010101010101010101010101, amount: 420 } }
|
|
// DKG #3 <==> Context ExodusContext { session: 16, network_id: 31337 }
|
|
gatekeeper.verify(
|
|
hex"3137142600000000000000000000000000000000000000000000000000000000000000100000000000007a690101010101010101010101010101010101010101000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000004482a21577000000000000000000000000010101010101010101010101010101010101010100000000000000000000000000000000000000000000000000000000000001a400000000000000000000000000000000000000000000000000000000",
|
|
0xb660d9d61850866db2ddcb6ee5a7ea06006ac4e76c9e42e56b2aae9c11219546,
|
|
0xe249616ba71082c4b7ea43dc9118afb3eaffdf8b5263ec87f30cc612e65d9d2b
|
|
);
|
|
|
|
address storageHistory = gatekeeper.storageHistory();
|
|
for (uint256 exodusSession; exodusSession < 19; exodusSession++) {
|
|
assert(IStorageHistory(storageHistory).isTransactionExecuted(exodusSession));
|
|
}
|
|
|
|
assert(!IStorageHistory(storageHistory).isTransactionExecuted(20));
|
|
}
|
|
}
|