Skip to content

Commit

Permalink
Set up token with constructor test
Browse files Browse the repository at this point in the history
  • Loading branch information
apbendi committed Oct 31, 2023
1 parent 82e8182 commit d5c7fb2
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 10 deletions.
3 changes: 1 addition & 2 deletions script/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ pragma solidity 0.8.22;
import {Script} from "forge-std/Script.sol";

contract Deploy is Script {

function run() public { }
function run() public {}
}
4 changes: 1 addition & 3 deletions src/GuineaPigGovernor.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.22;

contract GuineaPigGovernor {

}
contract GuineaPigGovernor {}
12 changes: 12 additions & 0 deletions src/GuineaPigToken.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.22;

import {
ERC20Votes,
ERC20Permit,
ERC20
} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Votes.sol";

contract GuineaPigToken is ERC20Votes {
constructor() ERC20("Guinea Pig DAO Token", "GPDT") ERC20Permit("Guinea Pig DAO Token") {}
}
7 changes: 2 additions & 5 deletions test/GuineaPigGovernor.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ pragma solidity 0.8.22;
import {Test, console2} from "forge-std/Test.sol";

contract GuineaPigGovernorTest is Test {
function setUp() public {
}
function setUp() public {}
}

contract Deployment is GuineaPigGovernorTest {

}
contract Deployment is GuineaPigGovernorTest {}
20 changes: 20 additions & 0 deletions test/GuineaPigToken.t.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.22;

import {Test, console2} from "forge-std/Test.sol";
import {GuineaPigToken} from "src/GuineaPigToken.sol";

contract GuineaPigTokenTest is Test {
GuineaPigToken gpdToken;

function setUp() public {
gpdToken = new GuineaPigToken();
}
}

contract Constructor is GuineaPigTokenTest {
function test_ConstructedCorrectly() public {
assertEq(gpdToken.name(), "Guinea Pig DAO Token");
assertEq(gpdToken.symbol(), "GPDT");
}
}

0 comments on commit d5c7fb2

Please sign in to comment.