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

3.1.0 & 3.1.1 #51

Merged
merged 4 commits into from
Apr 12, 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
19 changes: 19 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"wake.compiler.solc.remappings": [
"ds-test/=lib/forge-std/lib/ds-test/src/",
"forge-std/=lib/forge-std/src/",
"openzeppelin-upgradeable/=lib/tl-sol-tools/lib/openzeppelin-contracts-upgradeable/contracts/",
"openzeppelin/=lib/tl-sol-tools/lib/openzeppelin-contracts/contracts/",
"tl-sol-tools/=lib/tl-sol-tools/src/",
"@manifoldxyz/libraries-solidity/=lib/tl-sol-tools/lib/royalty-registry-solidity/lib/libraries-solidity/",
"@openzeppelin/contracts-upgradeable/=lib/tl-sol-tools/lib/openzeppelin-contracts-upgradeable/contracts/",
"@openzeppelin/contracts/=lib/tl-sol-tools/lib/openzeppelin-contracts/contracts/",
"create2-helpers/=lib/tl-sol-tools/lib/royalty-registry-solidity/lib/create2-helpers/",
"create2-scripts/=lib/tl-sol-tools/lib/royalty-registry-solidity/lib/create2-helpers/script/",
"erc4626-tests/=lib/tl-sol-tools/lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
"libraries-solidity/=lib/tl-sol-tools/lib/royalty-registry-solidity/lib/libraries-solidity/contracts/",
"royalty-registry-solidity/=lib/tl-sol-tools/lib/royalty-registry-solidity/",
"openzeppelin-contracts-upgradeable/=lib/tl-sol-tools/lib/openzeppelin-contracts-upgradeable/",
"openzeppelin-contracts/=lib/tl-sol-tools/lib/openzeppelin-contracts/"
]
}
50 changes: 50 additions & 0 deletions deployments.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
"constructor_args": "0x0000000000000000000000000000000000000000000000000000000000000001",
"salt": "0x0300010000000000000000000000000000000000000000000000000000000000",
"deployed_contract": "0x72be8d37610ee69c72a50fa9728cb4a795fbcf38"
},
"3.1.0": {
"constructor_args": "0x0000000000000000000000000000000000000000000000000000000000000001",
"salt": "0x0301000000000000000000000000000000000000000000000000000000000000",
"deployed_contract": "0xd631b04e8fdbe152ee4c05273588f444efdedfaf"
}
},
"ERC1155TL": {
Expand All @@ -21,6 +26,11 @@
"constructor_args": "0x0000000000000000000000000000000000000000000000000000000000000001",
"salt": "0x0300010000000000000000000000000000000000000000000000000000000000",
"deployed_contract": "0xe99fe9606b76a42b7ed69e13c6abbadb462626b8"
},
"3.1.0": {
"constructor_args": "0x0000000000000000000000000000000000000000000000000000000000000001",
"salt": "0x0301000000000000000000000000000000000000000000000000000000000000",
"deployed_contract": "0xe4c2c3f4a96f848dabffd2a69fb19675ae9c9cbc"
}
},
"Shatter": {
Expand All @@ -33,6 +43,11 @@
"constructor_args": "0x0000000000000000000000000000000000000000000000000000000000000001",
"salt": "0x0300010000000000000000000000000000000000000000000000000000000000",
"deployed_contract": "0xc41ea82091fe01dd3a853cad2e766e924e49f653"
},
"3.1.0": {
"constructor_args": "0x0000000000000000000000000000000000000000000000000000000000000001",
"salt": "0x0301000000000000000000000000000000000000000000000000000000000000",
"deployed_contract": "0xdae91e055bcc3a40c6154a003abc82d967627726"
}
},
"ERC7160TL": {
Expand All @@ -45,6 +60,16 @@
"constructor_args": "0x0000000000000000000000000000000000000000000000000000000000000001",
"salt": "0x0300010000000000000000000000000000000000000000000000000000000000",
"deployed_contract": "0x95c79af9e585751069fd710e05c78fbeb7679827"
},
"3.1.0": {
"constructor_args": "0x0000000000000000000000000000000000000000000000000000000000000001",
"salt": "0x0301000000000000000000000000000000000000000000000000000000000000",
"deployed_contract": "0xccbf31e3e7853709a40f9bc5f319afae6ba968a6"
},
"3.1.1": {
"constructor_args": "0x0000000000000000000000000000000000000000000000000000000000000001",
"salt": "0x0301010000000000000000000000000000000000000000000000000000000000",
"deployed_contract": "0x8bb44dc96d222f170efea8a60a389bd5c0c886a5"
}
},
"Doppelganger": {
Expand All @@ -57,6 +82,16 @@
"constructor_args": "0x0000000000000000000000000000000000000000000000000000000000000001",
"salt": "0x0300010000000000000000000000000000000000000000000000000000000000",
"deployed_contract": "0x053f8f66936e306cc8a5b24f2c111e90891f588e"
},
"3.1.0": {
"constructor_args": "0x0000000000000000000000000000000000000000000000000000000000000001",
"salt": "0x0301000000000000000000000000000000000000000000000000000000000000",
"deployed_contract": "0x78891719d07a2610d1c27ff40cd4eb40a6ee3ef6"
},
"3.1.1": {
"constructor_args": "0x0000000000000000000000000000000000000000000000000000000000000001",
"salt": "0x0301010000000000000000000000000000000000000000000000000000000000",
"deployed_contract": "0xc3225e41e5c88277e637f5298c9932b89d6ec3fa"
}
},
"CollectorsChoice": {
Expand All @@ -69,6 +104,16 @@
"constructor_args": "0x0000000000000000000000000000000000000000000000000000000000000001",
"salt": "0x0300010000000000000000000000000000000000000000000000000000000000",
"deployed_contract": "0x96310a20ffb00e0d1d29fc44cabed721d0fa7ee1"
},
"3.1.0": {
"constructor_args": "0x0000000000000000000000000000000000000000000000000000000000000001",
"salt": "0x0301000000000000000000000000000000000000000000000000000000000000",
"deployed_contract": "0x63f90b43dad3d82d69bc95f36523972cbb6c3c2a"
},
"3.1.1": {
"constructor_args": "0x0000000000000000000000000000000000000000000000000000000000000001",
"salt": "0x0301010000000000000000000000000000000000000000000000000000000000",
"deployed_contract": "0x8e163c6145182123ae55a5dbe386ac58bcf9e984"
}
},
"TRACE": {
Expand All @@ -81,6 +126,11 @@
"constructor_args": "0x0000000000000000000000000000000000000000000000000000000000000001",
"salt": "0x0300010000000000000000000000000000000000000000000000000000000000",
"deployed_contract": "0xd3a6ca43e1568815bbad091c36e531eb994b2a31"
},
"3.1.0": {
"constructor_args": "0x0000000000000000000000000000000000000000000000000000000000000001",
"salt": "0x0301000000000000000000000000000000000000000000000000000000000000",
"deployed_contract": "0x4e489788b7e5d5c1fd245eb237b2c0e1cbaa3a0b"
}
}
}
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ libs = ['lib']
evm_version = 'paris'
auto_detect_solc = true
optimizer = true
optimizer_runs = 20000
optimizer_runs = 10000
verbosity = 3
wrap_comments = true
gas_reports = ["ERC721TL", "ERC1155TL", "Doppelganger", "CollectorsChoice", "Shatter", "TRACE", "ERC7160TL"]
Expand Down
68 changes: 68 additions & 0 deletions script/Simulate.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.22;

import "forge-std/Script.sol";
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);
uint256 numTokens = 1_000_000;
uint256 batchSize = 200;

// deploy ERC7160TL contract
ERC7160TL c = new ERC7160TL(false);
c.initialize("Test", "TEST", "", address(1), 0, address(1), admins, true, address(0), address(0));

// mint tokens
for (uint256 i = 1; i <= numTokens; ++i) {
vm.prank(address(1));
c.mint(address(uint160(i)), "https://arweave.net/HzUUWz2uB4IxUPuLxbppi7SNbhFJrZFLVnZaVvFIGd0/0");
}

for (uint256 i = 0; i < numTokens / batchSize; ++i) {
// create token id array
uint256[] memory tokenIds = new uint256[](batchSize);
for (uint256 j = 0; j < batchSize; ++j) {
tokenIds[j] = j + 1 + i*batchSize;
}

// add token uris
uint256 gasPrior = gasleft();
vm.prank(address(1));
c.addTokenUris(tokenIds, "https://arweave.net/HzUUWz2uB4IxUPuLxbppi7SNbhFJrZFLVnZaVvFIGd0");
console.log(gasPrior - gasleft());
}
}
}

contract SimulateERC721TLAirdrop is Script {

function run() public {
// variables
address[] memory admins = new address[](0);
uint256 numTokens = 10_000;
uint256 batchSize = 250;

// deploy ERC721TL contract
ERC721TL c = new ERC721TL(false);
c.initialize("Test", "TEST", "", address(1), 0, address(1), admins, true, address(0), address(0));

for (uint256 i = 0; i < numTokens / batchSize; ++i) {
// create address array
address[] memory addresses = new address[](batchSize);
for (uint256 j = 0; j < batchSize; ++j) {
addresses[j] = address(uint160(j + 1 + i*batchSize));
}

// add token uris
uint256 gasPrior = gasleft();
vm.prank(address(1));
c.airdrop(addresses, "https://arweave.net/HzUUWz2uB4IxUPuLxbppi7SNbhFJrZFLVnZaVvFIGd0");
console.log(gasPrior - gasleft());
}
}
}
Loading
Loading