-
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
Nagesh #42
base: master
Are you sure you want to change the base?
Nagesh #42
Conversation
@@ -1,6 +1,42 @@ | |||
//SPDX-License-Identifier: Unlicense | |||
pragma solidity ^0.8.4; | |||
|
|||
// Smart Contract to deposit and withdraw | |||
contract Vault1 { |
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.
We need to make these transactions (deposit and withdraw) using ERC20 tokens
_mint(msg.sender, _amount); | ||
|
||
//fire event | ||
emit Mint(msg.sender, _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.
_mint already emits an event indicating a mint - https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol#L267
_burn(msg.sender,_amount); | ||
|
||
//fire event | ||
emit Burn(msg.sender, _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
Added Smart Contract logic in Vault1 and Vault2. Created Unit Tests and tested all the changes made in the Smart Contract code