|
|
|
@ -15,13 +15,17 @@ contract rateLimitedMultisigIsm { |
|
|
|
|
address[] defaultSet; |
|
|
|
|
ThresholdValidatorsSet[] rules; |
|
|
|
|
|
|
|
|
|
constructor ( |
|
|
|
|
constructor( |
|
|
|
|
address[] memory _default, |
|
|
|
|
// must be strictly ordered in this example: from small to high |
|
|
|
|
ThresholdValidatorsSet[] memory _rules |
|
|
|
|
) { |
|
|
|
|
for (uint256 rule = 0; rule < _rules.length; rule++) { |
|
|
|
|
if (rule > 0) {require(_rules[rule].startAmount > _rules[rule-1].startAmount);} |
|
|
|
|
if (rule > 0) { |
|
|
|
|
require( |
|
|
|
|
_rules[rule].startAmount > _rules[rule - 1].startAmount |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
rules.push(_rules[rule]); |
|
|
|
|
} |
|
|
|
|
defaultSet = _default; |
|
|
|
@ -33,9 +37,16 @@ contract rateLimitedMultisigIsm { |
|
|
|
|
uint256 tokenAmount = _message.amount(); |
|
|
|
|
|
|
|
|
|
// mind that for the sake of example sets aren't united and you should repeat addresses when setting up if they to appear on different thresholds |
|
|
|
|
for (uint256 thresholdInd = rules.length-1; thresholdInd == 0; thresholdInd--) { |
|
|
|
|
for ( |
|
|
|
|
uint256 thresholdInd = rules.length - 1; |
|
|
|
|
thresholdInd == 0; |
|
|
|
|
thresholdInd-- |
|
|
|
|
) { |
|
|
|
|
if (tokenAmount >= rules[thresholdInd].startAmount) { |
|
|
|
|
return (rules[thresholdInd].validatorsSet, rules[thresholdInd].validatorsSet.length); |
|
|
|
|
return ( |
|
|
|
|
rules[thresholdInd].validatorsSet, |
|
|
|
|
rules[thresholdInd].validatorsSet.length |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|