Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update TRACE addVerifiedStory Checks #52

Merged
merged 1 commit into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,17 @@ deploy_TRACE_arbitrum_sepolia: build
forge verify-contract $$(cat out.txt) src/erc-721/trace/TRACE.sol:TRACE --verifier-url https://api-sepolia.arbiscan.io/api --etherscan-api-key ${ARBISCAN_KEY} --watch --constructor-args ${CONSTRUCTOR_ARGS}
@bash print_and_clean.sh

deploy_TRACE_base_sepolia: build
forge script script/Deploy.s.sol:DeployTRACE --evm-version paris --rpc-url base_sepolia --ledger --sender ${SENDER} --broadcast
forge verify-contract $$(cat out.txt) src/erc-721/trace/TRACE.sol:TRACE --chain base-sepolia --watch --constructor-args ${CONSTRUCTOR_ARGS}
@bash print_and_clean.sh

deploy_TRACE_arbitrum_one: build
forge script script/Deploy.s.sol:DeployTRACE --evm-version paris --rpc-url arbitrum --ledger --sender ${SENDER} --broadcast
forge verify-contract $$(cat out.txt) src/erc-721/trace/TRACE.sol:TRACE --chain arbitrum --watch --constructor-args ${CONSTRUCTOR_ARGS}
@bash print_and_clean.sh

deploy_TRACE_base: build
forge script script/Deploy.s.sol:DeployTRACE --evm-version paris --rpc-url base --ledger --sender ${SENDER} --broadcast
forge verify-contract $$(cat out.txt) src/erc-721/trace/TRACE.sol:TRACE --chain base --watch --constructor-args ${CONSTRUCTOR_ARGS}
@bash print_and_clean.sh
5 changes: 5 additions & 0 deletions deployments.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@
"constructor_args": "0x0000000000000000000000000000000000000000000000000000000000000001",
"salt": "0x0301000000000000000000000000000000000000000000000000000000000000",
"deployed_contract": "0x4e489788b7e5d5c1fd245eb237b2c0e1cbaa3a0b"
},
"3.1.2": {
"constructor_args": "0x0000000000000000000000000000000000000000000000000000000000000001",
"salt": "0x0301020000000000000000000000000000000000000000000000000000000000",
"deployed_contract": "0xada0e41a41081ecd4803a3070e399bc3adaa0970"
}
}
}
8 changes: 3 additions & 5 deletions script/Simulate.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {ERC7160TL} from "../src/erc-721/multi-metadata/ERC7160TL.sol";
import {ERC721TL} from "../src/erc-721/ERC721TL.sol";

contract Simulate7160AddTokenUris is Script {

function run() public {
// variables
address[] memory admins = new address[](0);
Expand All @@ -27,7 +26,7 @@ contract Simulate7160AddTokenUris is Script {
// create token id array
uint256[] memory tokenIds = new uint256[](batchSize);
for (uint256 j = 0; j < batchSize; ++j) {
tokenIds[j] = j + 1 + i*batchSize;
tokenIds[j] = j + 1 + i * batchSize;
}

// add token uris
Expand All @@ -40,7 +39,6 @@ contract Simulate7160AddTokenUris is Script {
}

contract SimulateERC721TLAirdrop is Script {

function run() public {
// variables
address[] memory admins = new address[](0);
Expand All @@ -55,7 +53,7 @@ contract SimulateERC721TLAirdrop is Script {
// create address array
address[] memory addresses = new address[](batchSize);
for (uint256 j = 0; j < batchSize; ++j) {
addresses[j] = address(uint160(j + 1 + i*batchSize));
addresses[j] = address(uint160(j + 1 + i * batchSize));
}

// add token uris
Expand All @@ -65,4 +63,4 @@ contract SimulateERC721TLAirdrop is Script {
console.log(gasPrior - gasleft());
}
}
}
}
1 change: 0 additions & 1 deletion src/erc-721/multi-metadata/ERC7160TL.sol
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,6 @@ contract ERC7160TL is
emit BatchMetadataUpdate(1, _counter);
}


/// @notice Function to add token uris
/// @dev Written to take in many token ids and a base uri that contains metadata files with file names matching the index of each token id in the `tokenIds` array (aka folderIndex)
/// @dev No trailing slash on the base uri
Expand Down
6 changes: 3 additions & 3 deletions src/erc-721/trace/TRACE.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {ITRACE} from "./ITRACE.sol";
/// @title TRACE.sol
/// @notice Sovereign T.R.A.C.E. Creator Contract allowing for digital Certificates of Authenticity backed by the blockchain
/// @author transientlabs.xyz
/// @custom:version 3.1.0
/// @custom:version 3.1.2
contract TRACE is
ERC721Upgradeable,
ReentrancyGuardUpgradeable,
Expand Down Expand Up @@ -59,7 +59,7 @@ contract TRACE is
State Variables
//////////////////////////////////////////////////////////////////////////*/

string public constant VERSION = "3.1.0";
string public constant VERSION = "3.1.2";
bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE");
bytes32 public constant APPROVED_MINT_CONTRACT = keccak256("APPROVED_MINT_CONTRACT");
ITRACERSRegistry public tracersRegistry;
Expand Down Expand Up @@ -232,7 +232,7 @@ contract TRACE is
external
nonReentrant
{
if (tokenIds.length != stories.length && stories.length != signatures.length) {
if (tokenIds.length != stories.length || stories.length != signatures.length) {
revert ArrayLengthMismatch();
}
for (uint256 i = 0; i < tokenIds.length; i++) {
Expand Down
4 changes: 3 additions & 1 deletion test/erc-721/multi-metadata/CollectorsChoice.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1753,7 +1753,9 @@ contract CollectorsChoiceTest is Test {
users[0] = user;

// user can't access
vm.expectRevert(abi.encodeWithSelector(OwnableAccessControlUpgradeable.NotRoleOrOwner.selector, tokenContract.ADMIN_ROLE()));
vm.expectRevert(
abi.encodeWithSelector(OwnableAccessControlUpgradeable.NotRoleOrOwner.selector, tokenContract.ADMIN_ROLE())
);
vm.prank(user);
tokenContract.setUnpinnedFloatState(true);

Expand Down
4 changes: 3 additions & 1 deletion test/erc-721/multi-metadata/Doppelganger.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1751,7 +1751,9 @@ contract DoppelgangerTest is Test {
users[0] = user;

// user can't access
vm.expectRevert(abi.encodeWithSelector(OwnableAccessControlUpgradeable.NotRoleOrOwner.selector, tokenContract.ADMIN_ROLE()));
vm.expectRevert(
abi.encodeWithSelector(OwnableAccessControlUpgradeable.NotRoleOrOwner.selector, tokenContract.ADMIN_ROLE())
);
vm.prank(user);
tokenContract.setUnpinnedFloatState(true);

Expand Down
4 changes: 3 additions & 1 deletion test/erc-721/multi-metadata/ERC7160TL.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1613,7 +1613,9 @@ contract ERC7160TLTest is Test {
users[0] = user;

// user can't access
vm.expectRevert(abi.encodeWithSelector(OwnableAccessControlUpgradeable.NotRoleOrOwner.selector, tokenContract.ADMIN_ROLE()));
vm.expectRevert(
abi.encodeWithSelector(OwnableAccessControlUpgradeable.NotRoleOrOwner.selector, tokenContract.ADMIN_ROLE())
);
vm.prank(user);
tokenContract.setUnpinnedFloatState(true);

Expand Down
2 changes: 1 addition & 1 deletion test/erc-721/trace/TRACE.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ contract TRACETest is Test {
uint256[] memory tokenIds = new uint256[](len1);
string[] memory stories = new string[](len2);
bytes[] memory sigs = new bytes[](len3);
if (len1 != len2 && len2 != len3) {
if (len1 != len2 || len2 != len3 || len1 != len3) {
vm.expectRevert(TRACE.ArrayLengthMismatch.selector);
trace.addVerifiedStory(tokenIds, stories, sigs);
}
Expand Down
Loading