-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clean migrations and contracts and enable maxPerToken #28
base: master
Are you sure you want to change the base?
Conversation
bravepooh
commented
May 3, 2022
- Clean Contracts and migrations folders.
- enable MaxPerToken in allowTokens.sol
@@ -163,5 +172,16 @@ contract AllowTokens is IAllowTokens, Ownable { | |||
minAllowedToken[token] = _minAmount; | |||
emit FeeAndMinPerTokenChanged(token, _feeConst, _minAmount); | |||
} | |||
function setMaxPerToken(address token, uint256 _maxAmount) external onlyOwner { | |||
require(_maxAmount <= maxTokensAllowed, "AllowTokens: Max Tokens should be equal or smaller than Max Tokens"); | |||
require(minAllowedToken[token] <= _maxAmount, "AllowTokens: maxAllowedToken[] should be equal or bigger than minAllowedToken[]"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could also validate this in setFeeAndMinPerToken
(if maxAllowdToken[token] != 0
)
@@ -0,0 +1,10 @@ | |||
const MultiSigWallet = artifacts.require("MultiSigWallet"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know how the migrations are used, but is it right to edit the old migration instead of creating a new one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cleanup of migrations folder and contracts folder
|
||
result = await this.allowTokens.isValidTokenTransfer(this.token.address, web3.utils.toWei('2'), 0, true); | ||
assert.equal(result, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add one test here, setMaxPerToken(this.token.address, 0, {from: manage})
and then check that the maximum is unset (ie. 3
is valid again)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some small suggestions. I think the only thing that 100% should be done is to validate that the minimum is not set bigger than maximum in setFeeAndMinPerToken
but generally it's ok, no bugs.