generated from dewiz-xyz/foundry-template
-
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
1 parent
bcc1e48
commit 9bb5868
Showing
4 changed files
with
153 additions
and
85 deletions.
There are no files selected for viewing
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,17 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.19; | ||
|
||
import {Script} from "forge-std/Script.sol"; | ||
import {Denarius} from "./Denarius.sol"; | ||
|
||
contract DenariusDeploy is Script { | ||
function run() external returns (Denarius) { | ||
vm.startBroadcast(); | ||
|
||
Denarius tpl = new Denarius(); | ||
|
||
vm.stopBroadcast(); | ||
|
||
return tpl; | ||
} | ||
} |
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,17 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.19; | ||
|
||
import {ERC20} from "openzeppelin/token/ERC20/ERC20.sol"; | ||
import {ERC20Burnable} from "openzeppelin/token/ERC20/extensions/ERC20Burnable.sol"; | ||
import {ERC20Permit} from "openzeppelin/token/ERC20/extensions/ERC20Permit.sol"; | ||
import {Ownable} from "openzeppelin/access/Ownable.sol"; | ||
|
||
contract Denarius is ERC20, ERC20Burnable, Ownable, ERC20Permit { | ||
constructor() ERC20("Denarius", "SPQR") ERC20Permit("Denarius") { | ||
_mint(msg.sender, 1 * 10**decimals()); | ||
} | ||
|
||
function mint(address to, uint256 amount) public onlyOwner { | ||
_mint(to, amount); | ||
} | ||
} |
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,31 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.19; | ||
|
||
import {Test, console2} from "forge-std/Test.sol"; | ||
import {Denarius} from "./Denarius.sol"; | ||
|
||
//Denarius test | ||
contract DenariusTest is Test { | ||
Denarius internal template; | ||
address public sender; | ||
|
||
function setUp() public { | ||
sender = address(0x7FA9385bE102ac3EAc297483Dd6233D62b3e1496); | ||
template = new Denarius(); | ||
} | ||
|
||
function testFailBasicSanity() public { | ||
assertTrue(false); | ||
} | ||
|
||
function testBasicSanity() public { | ||
assertTrue(true); | ||
} | ||
|
||
function testBalance() public { | ||
uint256 supposedBalance = 1 * uint256(10**template.decimals()); | ||
uint256 balance = template.balanceOf(sender); | ||
console2.log("Balances: %d - %d", supposedBalance, balance); | ||
assertEq(supposedBalance, balance); | ||
} | ||
} |
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