Skip to content

Commit

Permalink
rename function
Browse files Browse the repository at this point in the history
  • Loading branch information
0xPilou committed Dec 4, 2023
1 parent fdefa56 commit e4623fc
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 22 deletions.
8 changes: 4 additions & 4 deletions forge-cache/solidity-files-cache.json
Original file line number Diff line number Diff line change
Expand Up @@ -7224,8 +7224,8 @@
}
},
"src/token/ERC721/ERC721ABLECoin.sol": {
"lastModificationDate": 1701684802308,
"contentHash": "f8dd91e4bf849bdf67facb04b07bbea6",
"lastModificationDate": 1701693150865,
"contentHash": "5d743c18e36e3005bdaf63c940518c55",
"sourceName": "src/token/ERC721/ERC721ABLECoin.sol",
"solcConfig": {
"settings": {
Expand Down Expand Up @@ -8697,8 +8697,8 @@
}
},
"test/token/ERC721/ERC721ABLECoin.t.sol": {
"lastModificationDate": 1701683714971,
"contentHash": "a1020d6757a8b89327a2b1eda4ed56ac",
"lastModificationDate": 1701693188351,
"contentHash": "5096108516b4faa73cf1429b124c3a1e",
"sourceName": "test/token/ERC721/ERC721ABLECoin.t.sol",
"solcConfig": {
"settings": {
Expand Down
10 changes: 5 additions & 5 deletions src/token/ERC721/ERC721ABLECoin.sol
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,14 @@ contract ERC721ABLECoin is ERC721AB {
* @param _signature signature to verify allowlist status
* @param _kycSignature signature to verify user's KYC status
*/
function mintCoin(
function mintWithERC20(
address _to,
uint256 _phaseId,
uint256 _quantity,
bytes calldata _signature,
bytes calldata _kycSignature
) external {
_mintCoin(_to, _phaseId, _quantity, _signature, _kycSignature);
_mintWithERC20(_to, _phaseId, _quantity, _signature, _kycSignature);
}

/**
Expand All @@ -171,7 +171,7 @@ contract ERC721ABLECoin is ERC721AB {
* @param _signature signature to verify allowlist status
* @param _kycSignature signature to verify user's KYC status
*/
function mintCoinWithPermit(
function mintWithERC20Permit(
address _to,
uint256 _phaseId,
uint256 _quantity,
Expand All @@ -185,7 +185,7 @@ contract ERC721ABLECoin is ERC721AB {
IERC20Permit(address(mintCurrency)).permit(
msg.sender, address(this), priceCurrency * _quantity, deadline, v, r, s
);
_mintCoin(_to, _phaseId, _quantity, _signature, _kycSignature);
_mintWithERC20(_to, _phaseId, _quantity, _signature, _kycSignature);
}

// ____ __ ___ __ _
Expand Down Expand Up @@ -293,7 +293,7 @@ contract ERC721ABLECoin is ERC721AB {
* @param _signature signature to verify allowlist status
* @param _kycSignature signature to verify user's KYC status
*/
function _mintCoin(
function _mintWithERC20(
address _to,
uint256 _phaseId,
uint256 _quantity,
Expand Down
25 changes: 12 additions & 13 deletions test/token/ERC721/ERC721ABLECoin.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
pragma solidity ^0.8.18;

import "forge-std/Test.sol";
import "forge-std/StdUtils.sol";

import {ERC721ABLECoin} from "src/token/ERC721/ERC721ABLECoin.sol";
import {ERC1155AB} from "src/token/ERC1155/ERC1155AB.sol";
Expand Down Expand Up @@ -605,7 +604,7 @@ contract ERC721ABLECoinTest is Test, ERC721ABCoinTestData {
// Impersonate `alice`
vm.startPrank(alice);
mockUSDC.approve(address(nft), PRICE_CURRENCY);
nft.mintCoin(alice, PHASE_ID_0, 1, signature, kycSignature);
nft.mintWithERC20(alice, PHASE_ID_0, 1, signature, kycSignature);
vm.stopPrank();

assertEq(nft.balanceOf(alice), 1);
Expand Down Expand Up @@ -642,7 +641,7 @@ contract ERC721ABLECoinTest is Test, ERC721ABCoinTestData {

vm.startPrank(alice);
mockUSDC.approve(address(nft), PRICE_CURRENCY * mintQty);
nft.mintCoin(alice, PHASE_ID_0, mintQty, signature, kycSignature);
nft.mintWithERC20(alice, PHASE_ID_0, mintQty, signature, kycSignature);
vm.stopPrank();

signature = _generateBackendSignature(bob, address(nft), PHASE_ID_0);
Expand All @@ -651,7 +650,7 @@ contract ERC721ABLECoinTest is Test, ERC721ABCoinTestData {
vm.startPrank(bob);
mockUSDC.approve(address(nft), PRICE_CURRENCY);
vm.expectRevert(ABErrors.NOT_ENOUGH_TOKEN_AVAILABLE.selector);
nft.mintCoin(bob, PHASE_ID_0, 1, signature, kycSignature);
nft.mintWithERC20(bob, PHASE_ID_0, 1, signature, kycSignature);
vm.stopPrank();
}

Expand Down Expand Up @@ -686,7 +685,7 @@ contract ERC721ABLECoinTest is Test, ERC721ABCoinTestData {

vm.startPrank(alice);
mockUSDC.approve(address(nft), PRICE_CURRENCY * aliceMintQty);
nft.mintCoin(alice, PHASE_ID_0, aliceMintQty, signature, kycSignature);
nft.mintWithERC20(alice, PHASE_ID_0, aliceMintQty, signature, kycSignature);
vm.stopPrank();

uint256 bobMintQty = 2;
Expand All @@ -696,7 +695,7 @@ contract ERC721ABLECoinTest is Test, ERC721ABCoinTestData {
vm.startPrank(bob);
mockUSDC.approve(address(nft), PRICE_CURRENCY * bobMintQty);
vm.expectRevert(ABErrors.NOT_ENOUGH_TOKEN_AVAILABLE.selector);
nft.mintCoin(bob, PHASE_ID_0, bobMintQty, signature, kycSignature);
nft.mintWithERC20(bob, PHASE_ID_0, bobMintQty, signature, kycSignature);
vm.stopPrank();
}

Expand All @@ -722,7 +721,7 @@ contract ERC721ABLECoinTest is Test, ERC721ABCoinTestData {
vm.startPrank(alice);
mockUSDC.approve(address(nft), PRICE_CURRENCY * aliceMintQty);
vm.expectRevert();
nft.mintCoin(alice, PHASE_ID_0, aliceMintQty, signature, kycSignature);
nft.mintWithERC20(alice, PHASE_ID_0, aliceMintQty, signature, kycSignature);
vm.stopPrank();
}

Expand Down Expand Up @@ -806,7 +805,7 @@ contract ERC721ABLECoinTest is Test, ERC721ABCoinTestData {
mockUSDC.approve(address(nft), PRICE_CURRENCY * mintQty);

vm.expectRevert(ABErrors.MAX_MINT_PER_ADDRESS.selector);
nft.mintCoin(alice, PHASE_ID_0, mintQty, signature, kycSignature);
nft.mintWithERC20(alice, PHASE_ID_0, mintQty, signature, kycSignature);

vm.stopPrank();
}
Expand Down Expand Up @@ -846,7 +845,7 @@ contract ERC721ABLECoinTest is Test, ERC721ABCoinTestData {

mockUSDC.approve(address(nft), PRICE_CURRENCY * mintQty);
vm.expectRevert(ABErrors.PHASE_NOT_ACTIVE.selector);
nft.mintCoin(alice, PHASE_ID_0, mintQty, signature, kycSignature);
nft.mintWithERC20(alice, PHASE_ID_0, mintQty, signature, kycSignature);

vm.stopPrank();
}
Expand Down Expand Up @@ -886,7 +885,7 @@ contract ERC721ABLECoinTest is Test, ERC721ABCoinTestData {
mockUSDC.approve(address(nft), PRICE_CURRENCY * mintQty);

vm.expectRevert(ABErrors.NOT_ELIGIBLE.selector);
nft.mintCoin(alice, PHASE_ID_0, mintQty, invalidSignature, kycSignature);
nft.mintWithERC20(alice, PHASE_ID_0, mintQty, invalidSignature, kycSignature);

vm.stopPrank();
}
Expand Down Expand Up @@ -922,7 +921,7 @@ contract ERC721ABLECoinTest is Test, ERC721ABCoinTestData {

uint256 mintQty = 4;
mockUSDC.approve(address(nft), PRICE_CURRENCY * mintQty);
nft.mintCoin(alice, PHASE_ID_0, mintQty, "", kycSignature);
nft.mintWithERC20(alice, PHASE_ID_0, mintQty, "", kycSignature);

assertEq(nft.balanceOf(alice), mintQty);

Expand Down Expand Up @@ -957,7 +956,7 @@ contract ERC721ABLECoinTest is Test, ERC721ABCoinTestData {

// Impersonate `alice`
vm.prank(alice);
nft.mintCoinWithPermit(alice, PHASE_ID_0, 1, 1e18 days, v, r, s, signature, kycSignature);
nft.mintWithERC20Permit(alice, PHASE_ID_0, 1, 1e18 days, v, r, s, signature, kycSignature);

assertEq(nft.balanceOf(alice), 1);
}
Expand Down Expand Up @@ -1133,7 +1132,7 @@ contract ERC721ABLECoinTest is Test, ERC721ABCoinTestData {
address(mockUSDC),
URI
);

abDataRegistry.setDropFee(true, nft.dropId(), 0);

vm.prank(publisher);
Expand Down

0 comments on commit e4623fc

Please sign in to comment.