nullified balance gov withdrawal

This commit is contained in:
gozzy 2023-04-13 20:14:51 +00:00
parent 45db3dd73a
commit 4e08783bd1
2 changed files with 27 additions and 2 deletions

View File

@ -1,12 +1,23 @@
pragma solidity 0.8.1;
import "@interfaces/IRelayerRegistry.sol";
import "@interfaces/IStakingRewards.sol";
contract Proposal {
function executeProposal() external {
uint256 NEW_MINIMUM_STAKE_AMOUNT = 2000 ether;
function getNullifiedTotal(address[11] memory relayers) public returns (uint256) {
uint256 nullifiedTotal;
address _registryAddress = 0x58E8dCC13BE9780fC42E8723D8EaD4CF46943dF2;
for (uint8 x = 0; x < relayers.length; x++) {
nullifiedTotal += IRelayerRegistry(_registryAddress).getRelayerBalance(relayers[x]);
}
return nullifiedTotal;
}
function executeProposal() external {
address[11] memory VIOLATING_RELAYERS = [
0x30F96AEF199B399B722F8819c9b0723016CEAe6C, // moon-relayer.eth
0xEFa22d23de9f293B11e0c4aC865d7b440647587a, // tornado-relayer.eth
@ -21,7 +32,11 @@ contract Proposal {
0x12D92FeD171F16B3a05ACB1542B40648E7CEd384 // torn-relayers.eth
];
uint256 NEW_MINIMUM_STAKE_AMOUNT = 2000 ether;
uint256 NULLIFIED_TOTAL_AMOUNT = getNullifiedTotal(VIOLATING_RELAYERS);
address _registryAddress = 0x58E8dCC13BE9780fC42E8723D8EaD4CF46943dF2;
address _stakingAddress = 0x2FC93484614a34f26F7970CBB94615bA109BB4bf;
IRelayerRegistry(_registryAddress).setMinStakeAmount(NEW_MINIMUM_STAKE_AMOUNT);
@ -36,6 +51,9 @@ contract Proposal {
IRelayerRegistry(_registryAddress).nullifyBalance(VIOLATING_RELAYERS[8]);
IRelayerRegistry(_registryAddress).nullifyBalance(VIOLATING_RELAYERS[9]);
IRelayerRegistry(_registryAddress).nullifyBalance(VIOLATING_RELAYERS[10]);
IStakingRewards(_stakingAddress).withdrawTorn(NULLIFIED_TOTAL_AMOUNT);
}
}

View File

@ -0,0 +1,7 @@
pragma solidity ^0.8.1;
interface IStakingRewards {
function withdrawTorn(uint256 amount) external;
}