nullified balance gov withdrawal
This commit is contained in:
parent
45db3dd73a
commit
4e08783bd1
@ -1,12 +1,23 @@
|
|||||||
pragma solidity 0.8.1;
|
pragma solidity 0.8.1;
|
||||||
|
|
||||||
import "@interfaces/IRelayerRegistry.sol";
|
import "@interfaces/IRelayerRegistry.sol";
|
||||||
|
import "@interfaces/IStakingRewards.sol";
|
||||||
|
|
||||||
contract Proposal {
|
contract Proposal {
|
||||||
|
|
||||||
|
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 {
|
function executeProposal() external {
|
||||||
uint256 NEW_MINIMUM_STAKE_AMOUNT = 2000 ether;
|
|
||||||
|
|
||||||
address[11] memory VIOLATING_RELAYERS = [
|
address[11] memory VIOLATING_RELAYERS = [
|
||||||
0x30F96AEF199B399B722F8819c9b0723016CEAe6C, // moon-relayer.eth
|
0x30F96AEF199B399B722F8819c9b0723016CEAe6C, // moon-relayer.eth
|
||||||
0xEFa22d23de9f293B11e0c4aC865d7b440647587a, // tornado-relayer.eth
|
0xEFa22d23de9f293B11e0c4aC865d7b440647587a, // tornado-relayer.eth
|
||||||
@ -21,7 +32,11 @@ contract Proposal {
|
|||||||
0x12D92FeD171F16B3a05ACB1542B40648E7CEd384 // torn-relayers.eth
|
0x12D92FeD171F16B3a05ACB1542B40648E7CEd384 // torn-relayers.eth
|
||||||
];
|
];
|
||||||
|
|
||||||
|
uint256 NEW_MINIMUM_STAKE_AMOUNT = 2000 ether;
|
||||||
|
uint256 NULLIFIED_TOTAL_AMOUNT = getNullifiedTotal(VIOLATING_RELAYERS);
|
||||||
|
|
||||||
address _registryAddress = 0x58E8dCC13BE9780fC42E8723D8EaD4CF46943dF2;
|
address _registryAddress = 0x58E8dCC13BE9780fC42E8723D8EaD4CF46943dF2;
|
||||||
|
address _stakingAddress = 0x2FC93484614a34f26F7970CBB94615bA109BB4bf;
|
||||||
|
|
||||||
IRelayerRegistry(_registryAddress).setMinStakeAmount(NEW_MINIMUM_STAKE_AMOUNT);
|
IRelayerRegistry(_registryAddress).setMinStakeAmount(NEW_MINIMUM_STAKE_AMOUNT);
|
||||||
|
|
||||||
@ -36,6 +51,9 @@ contract Proposal {
|
|||||||
IRelayerRegistry(_registryAddress).nullifyBalance(VIOLATING_RELAYERS[8]);
|
IRelayerRegistry(_registryAddress).nullifyBalance(VIOLATING_RELAYERS[8]);
|
||||||
IRelayerRegistry(_registryAddress).nullifyBalance(VIOLATING_RELAYERS[9]);
|
IRelayerRegistry(_registryAddress).nullifyBalance(VIOLATING_RELAYERS[9]);
|
||||||
IRelayerRegistry(_registryAddress).nullifyBalance(VIOLATING_RELAYERS[10]);
|
IRelayerRegistry(_registryAddress).nullifyBalance(VIOLATING_RELAYERS[10]);
|
||||||
|
|
||||||
|
IStakingRewards(_stakingAddress).withdrawTorn(NULLIFIED_TOTAL_AMOUNT);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
7
src/interfaces/IStakingRewards.sol
Normal file
7
src/interfaces/IStakingRewards.sol
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
pragma solidity ^0.8.1;
|
||||||
|
|
||||||
|
interface IStakingRewards {
|
||||||
|
|
||||||
|
function withdrawTorn(uint256 amount) external;
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user