Skip to content

Commit 60a1b99

Browse files
Rename mint to mintTo on ERC20Base (#236)
* Rename mint to mintTo on ERC20Base * Update ERC20Vote and tests * Remove .DS_Store
1 parent a8a1808 commit 60a1b99

File tree

6 files changed

+24
-22
lines changed

6 files changed

+24
-22
lines changed

.DS_Store

-8 KB
Binary file not shown.

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,5 @@ corpus/
5454

5555
# IDES
5656
.idea
57+
58+
*.DS_Store

contracts/base/ERC20Base.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ contract ERC20Base is ContractMetadata, Multicall, Ownable, ERC20Permit {
4242
* @param _to The recipient of the tokens to mint.
4343
* @param _amount Quantity of tokens to mint.
4444
*/
45-
function mint(address _to, uint256 _amount) public virtual {
45+
function mintTo(address _to, uint256 _amount) public virtual {
4646
require(_canMint(), "Not authorized to mint.");
4747
require(_amount != 0, "Minting zero tokens.");
4848

contracts/base/ERC20Vote.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ contract ERC20Vote is ContractMetadata, Multicall, Ownable, ERC20Votes {
4242
* @param _to The recipient of the tokens to mint.
4343
* @param _amount Quantity of tokens to mint.
4444
*/
45-
function mint(address _to, uint256 _amount) public virtual {
45+
function mintTo(address _to, uint256 _amount) public virtual {
4646
require(_canMint(), "Not authorized to mint.");
4747
require(_amount != 0, "Minting zero tokens.");
4848

src/test/sdk/base/ERC20Base.t.sol

+10-10
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ contract BaseERC20BaseTest is BaseUtilTest {
5050
uint256 currentBalanceOfRecipient = base.balanceOf(recipient);
5151

5252
vm.prank(deployer);
53-
base.mint(recipient, amount);
53+
base.mintTo(recipient, amount);
5454

5555
assertEq(base.totalSupply(), currentTotalSupply + amount);
5656
assertEq(base.balanceOf(recipient), currentBalanceOfRecipient + amount);
@@ -61,23 +61,23 @@ contract BaseERC20BaseTest is BaseUtilTest {
6161

6262
vm.expectRevert("Not authorized to mint.");
6363
vm.prank(address(0x1));
64-
base.mint(recipient, amount);
64+
base.mintTo(recipient, amount);
6565
}
6666

6767
function test_revert_mint_MintingZeroTokens() public {
6868
uint256 amount = 0;
6969

7070
vm.expectRevert("Minting zero tokens.");
7171
vm.prank(deployer);
72-
base.mint(recipient, amount);
72+
base.mintTo(recipient, amount);
7373
}
7474

7575
function test_revert_mint_MintToZeroAddress() public {
7676
uint256 amount = 1;
7777

7878
vm.expectRevert("ERC20: mint to the zero address");
7979
vm.prank(deployer);
80-
base.mint(address(0), amount);
80+
base.mintTo(address(0), amount);
8181
}
8282

8383
/*///////////////////////////////////////////////////////////////
@@ -91,7 +91,7 @@ contract BaseERC20BaseTest is BaseUtilTest {
9191
uint256 currentBalanceOfRecipient = base.balanceOf(recipient);
9292

9393
vm.prank(deployer);
94-
base.mint(recipient, amount);
94+
base.mintTo(recipient, amount);
9595

9696
assertEq(base.totalSupply(), currentTotalSupply + amount);
9797
assertEq(base.balanceOf(recipient), currentBalanceOfRecipient + amount);
@@ -110,7 +110,7 @@ contract BaseERC20BaseTest is BaseUtilTest {
110110
uint256 amount = 5 ether;
111111

112112
vm.prank(deployer);
113-
base.mint(recipient, amount);
113+
base.mintTo(recipient, amount);
114114

115115
vm.expectRevert("not enough balance");
116116
vm.prank(recipient);
@@ -126,7 +126,7 @@ contract BaseERC20BaseTest is BaseUtilTest {
126126

127127
// mint amount to recipient
128128
vm.prank(deployer);
129-
base.mint(recipient, amount);
129+
base.mintTo(recipient, amount);
130130

131131
// generate permit signature
132132
address _owner = recipient;
@@ -160,7 +160,7 @@ contract BaseERC20BaseTest is BaseUtilTest {
160160

161161
// mint amount to recipient
162162
vm.prank(deployer);
163-
base.mint(recipient, amount);
163+
base.mintTo(recipient, amount);
164164

165165
// generate permit signature
166166
address _owner = recipient;
@@ -188,7 +188,7 @@ contract BaseERC20BaseTest is BaseUtilTest {
188188

189189
// mint amount to recipient
190190
vm.prank(deployer);
191-
base.mint(recipient, amount);
191+
base.mintTo(recipient, amount);
192192

193193
// generate permit signature
194194
address _owner = recipient;
@@ -222,7 +222,7 @@ contract BaseERC20BaseTest is BaseUtilTest {
222222

223223
// mint amount to recipient
224224
vm.prank(deployer);
225-
base.mint(recipient, amount);
225+
base.mintTo(recipient, amount);
226226

227227
// generate permit signature
228228
address _owner = recipient;

src/test/sdk/base/ERC20Vote.t.sol

+10-10
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ contract BaseERC20VoteTest is BaseUtilTest {
5454
uint256 currentBalanceOfRecipient = base.balanceOf(recipient);
5555

5656
vm.prank(deployer);
57-
base.mint(recipient, amount);
57+
base.mintTo(recipient, amount);
5858

5959
assertEq(base.totalSupply(), currentTotalSupply + amount);
6060
assertEq(base.balanceOf(recipient), currentBalanceOfRecipient + amount);
@@ -65,23 +65,23 @@ contract BaseERC20VoteTest is BaseUtilTest {
6565

6666
vm.expectRevert("Not authorized to mint.");
6767
vm.prank(address(0x1));
68-
base.mint(recipient, amount);
68+
base.mintTo(recipient, amount);
6969
}
7070

7171
function test_revert_mint_MintingZeroTokens() public {
7272
uint256 amount = 0;
7373

7474
vm.expectRevert("Minting zero tokens.");
7575
vm.prank(deployer);
76-
base.mint(recipient, amount);
76+
base.mintTo(recipient, amount);
7777
}
7878

7979
function test_revert_mint_MintToZeroAddress() public {
8080
uint256 amount = 1;
8181

8282
vm.expectRevert("ERC20: mint to the zero address");
8383
vm.prank(deployer);
84-
base.mint(address(0), amount);
84+
base.mintTo(address(0), amount);
8585
}
8686

8787
/*///////////////////////////////////////////////////////////////
@@ -95,7 +95,7 @@ contract BaseERC20VoteTest is BaseUtilTest {
9595
uint256 currentBalanceOfRecipient = base.balanceOf(recipient);
9696

9797
vm.prank(deployer);
98-
base.mint(recipient, amount);
98+
base.mintTo(recipient, amount);
9999

100100
assertEq(base.totalSupply(), currentTotalSupply + amount);
101101
assertEq(base.balanceOf(recipient), currentBalanceOfRecipient + amount);
@@ -114,7 +114,7 @@ contract BaseERC20VoteTest is BaseUtilTest {
114114
uint256 amount = 5 ether;
115115

116116
vm.prank(deployer);
117-
base.mint(recipient, amount);
117+
base.mintTo(recipient, amount);
118118

119119
vm.expectRevert("not enough balance");
120120
vm.prank(recipient);
@@ -130,7 +130,7 @@ contract BaseERC20VoteTest is BaseUtilTest {
130130

131131
// mint amount to recipient
132132
vm.prank(deployer);
133-
base.mint(recipient, amount);
133+
base.mintTo(recipient, amount);
134134

135135
// generate permit signature
136136
address _owner = recipient;
@@ -164,7 +164,7 @@ contract BaseERC20VoteTest is BaseUtilTest {
164164

165165
// mint amount to recipient
166166
vm.prank(deployer);
167-
base.mint(recipient, amount);
167+
base.mintTo(recipient, amount);
168168

169169
// generate permit signature
170170
address _owner = recipient;
@@ -192,7 +192,7 @@ contract BaseERC20VoteTest is BaseUtilTest {
192192

193193
// mint amount to recipient
194194
vm.prank(deployer);
195-
base.mint(recipient, amount);
195+
base.mintTo(recipient, amount);
196196

197197
// generate permit signature
198198
address _owner = recipient;
@@ -226,7 +226,7 @@ contract BaseERC20VoteTest is BaseUtilTest {
226226

227227
// mint amount to recipient
228228
vm.prank(deployer);
229-
base.mint(recipient, amount);
229+
base.mintTo(recipient, amount);
230230

231231
// generate permit signature
232232
address _owner = recipient;

0 commit comments

Comments
 (0)