Skip to content

Commit

Permalink
updated test scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
0xPilou committed Sep 28, 2023
1 parent b39838c commit b91c987
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
14 changes: 7 additions & 7 deletions test/factory/AnotherCloneFactory.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity ^0.8.18;

import "forge-std/Test.sol";

import {ERC721AB} from "src/token/ERC721/ERC721AB.sol";
import {ERC721ABLE} from "src/token/ERC721/ERC721ABLE.sol";
import {ERC1155AB} from "src/token/ERC1155/ERC1155AB.sol";
import {ABDataRegistry} from "src/utils/ABDataRegistry.sol";
import {AnotherCloneFactory} from "src/factory/AnotherCloneFactory.sol";
Expand All @@ -24,7 +24,7 @@ contract AnotherCloneFactoryTest is Test, AnotherCloneFactoryTestData {
AnotherCloneFactory public anotherCloneFactory;
ABRoyalty public royaltyImplementation;
ERC1155AB public erc1155Implementation;
ERC721AB public erc721Implementation;
ERC721ABLE public erc721Implementation;

ProxyAdmin public proxyAdmin;
TransparentUpgradeableProxy public anotherCloneFactoryProxy;
Expand Down Expand Up @@ -52,7 +52,7 @@ contract AnotherCloneFactoryTest is Test, AnotherCloneFactoryTestData {
erc1155Implementation = new ERC1155AB();
vm.label(address(erc1155Implementation), "erc1155Implementation");

erc721Implementation = new ERC721AB();
erc721Implementation = new ERC721ABLE();
vm.label(address(erc721Implementation), "erc721Implementation");

royaltyImplementation = new ABRoyalty();
Expand Down Expand Up @@ -219,7 +219,7 @@ contract AnotherCloneFactoryTest is Test, AnotherCloneFactoryTestData {
anotherCloneFactory.createCollection721(NAME, SALT);
(address nft, address publisher) = anotherCloneFactory.collections(0);

assertEq(ERC721AB(nft).owner(), _publisher);
assertEq(ERC721ABLE(nft).owner(), _publisher);
assertEq(publisher, _publisher);

vm.stopPrank();
Expand All @@ -246,7 +246,7 @@ contract AnotherCloneFactoryTest is Test, AnotherCloneFactoryTestData {
anotherCloneFactory.createCollection721FromImplementation(address(erc721Implementation), _publisher, NAME, SALT);
(address nft, address publisher) = anotherCloneFactory.collections(0);

assertEq(ERC721AB(nft).owner(), _publisher);
assertEq(ERC721ABLE(nft).owner(), _publisher);
assertEq(publisher, _publisher);

vm.stopPrank();
Expand Down Expand Up @@ -306,7 +306,7 @@ contract AnotherCloneFactoryTest is Test, AnotherCloneFactoryTestData {
}

function test_setERC721Implementation_admin() public {
ERC721AB newErc721Implementation = new ERC721AB();
ERC721ABLE newErc721Implementation = new ERC721ABLE();

assertEq(anotherCloneFactory.erc721Impl(), address(erc721Implementation));

Expand All @@ -318,7 +318,7 @@ contract AnotherCloneFactoryTest is Test, AnotherCloneFactoryTestData {
function test_setERC721Implementation_nonAdmin(address _nonAdmin) public {
vm.assume(_nonAdmin != address(this));

ERC721AB newErc721Implementation = new ERC721AB();
ERC721ABLE newErc721Implementation = new ERC721ABLE();

vm.prank(_nonAdmin);

Expand Down
6 changes: 3 additions & 3 deletions test/royalty/ABRoyalty.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity ^0.8.18;

import "forge-std/Test.sol";

import {ERC721AB} from "src/token/ERC721/ERC721AB.sol";
import {ERC721ABLE} from "src/token/ERC721/ERC721ABLE.sol";
import {ERC1155AB} from "src/token/ERC1155/ERC1155AB.sol";
import {ABDataRegistry} from "src/utils/ABDataRegistry.sol";
import {AnotherCloneFactory} from "src/factory/AnotherCloneFactory.sol";
Expand Down Expand Up @@ -35,7 +35,7 @@ contract ABRoyaltyTest is Test, ABRoyaltyTestData {
ABVerifier public abVerifier;
ABDataRegistry public abDataRegistry;
AnotherCloneFactory public anotherCloneFactory;
ERC721AB public erc721Impl;
ERC721ABLE public erc721Impl;
ERC1155AB public erc1155Impl;
ProxyAdmin public proxyAdmin;
TransparentUpgradeableProxy public anotherCloneFactoryProxy;
Expand Down Expand Up @@ -80,7 +80,7 @@ contract ABRoyaltyTest is Test, ABRoyaltyTestData {
erc1155Impl = new ERC1155AB();
vm.label(address(erc1155Impl), "erc1155Impl");

erc721Impl = new ERC721AB();
erc721Impl = new ERC721ABLE();
vm.label(address(erc721Impl), "erc721Impl");

abRoyaltyImpl = new ABRoyalty();
Expand Down
6 changes: 3 additions & 3 deletions test/token/ERC1155/ERC1155AB.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity ^0.8.18;

import "forge-std/Test.sol";

import {ERC721AB} from "src/token/ERC721/ERC721AB.sol";
import {ERC721ABLE} from "src/token/ERC721/ERC721ABLE.sol";
import {ERC1155AB} from "src/token/ERC1155/ERC1155AB.sol";
import {ABDataRegistry} from "src/utils/ABDataRegistry.sol";
import {AnotherCloneFactory} from "src/factory/AnotherCloneFactory.sol";
Expand Down Expand Up @@ -45,7 +45,7 @@ contract ERC1155ABTest is Test, ERC1155ABTestData, ERC1155Holder {
ABDataRegistry public abDataRegistry;
AnotherCloneFactory public anotherCloneFactory;
ABRoyalty public royaltyImpl;
ERC721AB public erc721Impl;
ERC721ABLE public erc721Impl;
ERC1155AB public erc1155Impl;
ProxyAdmin public proxyAdmin;
TransparentUpgradeableProxy public anotherCloneFactoryProxy;
Expand Down Expand Up @@ -109,7 +109,7 @@ contract ERC1155ABTest is Test, ERC1155ABTestData, ERC1155Holder {
erc1155Impl = new ERC1155AB();
vm.label(address(erc1155Impl), "erc1155Impl");

erc721Impl = new ERC721AB();
erc721Impl = new ERC721ABLE();
vm.label(address(erc721Impl), "erc721Impl");

royaltyImpl = new ABRoyalty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity ^0.8.18;

import "forge-std/Test.sol";

import {ERC721AB} from "src/token/ERC721/ERC721AB.sol";
import {ERC721ABLE} from "src/token/ERC721/ERC721ABLE.sol";
import {ERC1155AB} from "src/token/ERC1155/ERC1155AB.sol";
import {ABDataRegistry} from "src/utils/ABDataRegistry.sol";
import {AnotherCloneFactory} from "src/factory/AnotherCloneFactory.sol";
Expand All @@ -14,7 +14,7 @@ import {ABErrors} from "src/libraries/ABErrors.sol";

import {ABSuperToken} from "test/_mocks/ABSuperToken.sol";
import {MockToken} from "test/_mocks/MockToken.sol";
import {ERC721ABTestData} from "test/_testdata/ERC721AB.td.sol";
import {ERC721ABTestData} from "test/_testdata/ERC721ABLE.td.sol";

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
Expand Down Expand Up @@ -45,14 +45,14 @@ contract ERC721ABTest is Test, ERC721ABTestData {
ABDataRegistry public abDataRegistry;
AnotherCloneFactory public anotherCloneFactory;
ABRoyalty public royaltyImpl;
ERC721AB public erc721Impl;
ERC721ABLE public erc721Impl;
ERC1155AB public erc1155Impl;
ProxyAdmin public proxyAdmin;
TransparentUpgradeableProxy public anotherCloneFactoryProxy;
TransparentUpgradeableProxy public abDataRegistryProxy;
TransparentUpgradeableProxy public abVerifierProxy;

ERC721AB public nft;
ERC721ABLE public nft;

uint256 public constant DROP_ID_OFFSET = 10_000;

Expand Down Expand Up @@ -109,7 +109,7 @@ contract ERC721ABTest is Test, ERC721ABTestData {
erc1155Impl = new ERC1155AB();
vm.label(address(erc1155Impl), "erc1155Impl");

erc721Impl = new ERC721AB();
erc721Impl = new ERC721ABLE();
vm.label(address(erc721Impl), "erc721Impl");

royaltyImpl = new ABRoyalty();
Expand Down Expand Up @@ -153,17 +153,17 @@ contract ERC721ABTest is Test, ERC721ABTestData {

(address nftAddr,) = anotherCloneFactory.collections(0);

nft = ERC721AB(nftAddr);
nft = ERC721ABLE(nftAddr);
}

function test_initialize() public {
TransparentUpgradeableProxy erc721proxy = new TransparentUpgradeableProxy(
address(new ERC721AB()),
address(new ERC721ABLE()),
address(proxyAdmin),
""
);

nft = ERC721AB(address(erc721proxy));
nft = ERC721ABLE(address(erc721proxy));
nft.initialize(publisher, address(abDataRegistry), address(abVerifier), NAME);

assertEq(address(nft.abDataRegistry()), address(abDataRegistry));
Expand Down

0 comments on commit b91c987

Please sign in to comment.