-
Notifications
You must be signed in to change notification settings - Fork 66
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
Omard Vault Assignment #37
base: master
Are you sure you want to change the base?
Conversation
event withdrawalEvent(uint256 _amount); | ||
|
||
//Should take in deposit amount. Assume that the contract is pre-approved to transfer that amount | ||
function deposit(uint256 _amount) public payable { |
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.
This can be an external function
address public owner = msg.sender; | ||
VaultToken vaultToken = VaultToken(owner); | ||
|
||
mapping(address => mapping(ERC20 => uint256)) vaultBalance; |
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.
Since in this case vaultToken is fixed, why do we need this internal mapping from ERC20 to uint?
payable | ||
positiveAmounts(_amount) | ||
{ | ||
transfer(_toAddress, _amount); |
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.
Why not call the _mint
function here?
positiveAmounts(_amount) | ||
{ | ||
_burn(_toAddress, _amount); | ||
emit tokensBurned(_toAddress, _amount); |
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.
_burn also emits an event indicating a burn - https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol#L295
12/12 tests passing