-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
63 additions
and
57 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// SPDX-License-Identifier: MIT | ||
/* yak tracks all over the place */ | ||
pragma solidity 0.8.23; | ||
|
||
import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | ||
import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | ||
|
||
event Deposit(address indexed sender, uint256 originalTokenAmount); | ||
event Withdraw(address indexed receiver, uint256 originalTokenAmount); | ||
|
||
contract ERC20Amplifier is ERC20 { | ||
address public originalToken; | ||
uint256 public amplification; | ||
|
||
constructor(address _originalToken, uint256 _amplification, string memory _name, string memory _symbol) | ||
ERC20(_name, _symbol) | ||
{ | ||
originalToken = _originalToken; | ||
amplification = _amplification; | ||
} | ||
|
||
function deposit(uint256 _originalTokenAmount) public { | ||
require(_originalTokenAmount > 0, "!gt0"); | ||
|
||
_mint(msg.sender, _originalTokenAmount * amplification); | ||
IERC20(originalToken).transferFrom(msg.sender, address(this), _originalTokenAmount); | ||
|
||
emit Deposit(msg.sender, _originalTokenAmount); | ||
} | ||
|
||
function withdraw(uint256 _originalTokenAmount) external { | ||
require(_originalTokenAmount > 0, "!gt0"); | ||
|
||
_burn(msg.sender, _originalTokenAmount * amplification); | ||
IERC20(originalToken).transfer(msg.sender, _originalTokenAmount); | ||
|
||
emit Withdraw(msg.sender, _originalTokenAmount); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// // SPDX-License-Identifier: UNLICENSED | ||
// pragma solidity ^0.8.13; | ||
|
||
// import {Test, console} from "forge-std/Test.sol"; | ||
// import {Counter} from "../src/Counter.sol"; | ||
|
||
// contract CounterTest is Test { | ||
// Counter public counter; | ||
|
||
// function setUp() public { | ||
// counter = new Counter(); | ||
// counter.setNumber(0); | ||
// } | ||
|
||
// function test_Increment() public { | ||
// counter.increment(); | ||
// assertEq(counter.number(), 1); | ||
// } | ||
|
||
// function testFuzz_SetNumber(uint256 x) public { | ||
// counter.setNumber(x); | ||
// assertEq(counter.number(), x); | ||
// } | ||
// } |