-
Notifications
You must be signed in to change notification settings - Fork 2
Nialexsan/extra check erc4626 #79
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
Conversation
| access(self) fun _toCadenceOut( | ||
| _ amt: UInt256, | ||
| erc20Address: EVM.EVMAddress | ||
| ): UFix64 { | ||
| // Bridge utils already floors when going UInt256 -> UFix64 | ||
| return FlowEVMBridgeUtils.convertERC20AmountToCadenceAmount( | ||
| amt, | ||
| erc20Address: erc20Address | ||
| ) | ||
| } | ||
|
|
||
| /// IN amounts: round up to the next UFix64 such that the ERC20 conversion | ||
| /// (via ufix64ToUInt256) is >= the original UInt256 amount. | ||
| access(self) fun _toCadenceIn( | ||
| _ amt: UInt256, | ||
| erc20Address: EVM.EVMAddress | ||
| ): UFix64 { |
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.
IMO we should add test cases & ensure cases across extremes are covered since rounding is a common failure point. Will likely require exposing _toCadenceIn() these methods as access(all)
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 tests and moved the methods to the contract level for convenience
No description provided.