drop erc721a due to crazy gas reqs

master
lza_menace 2 years ago
parent b1496229b0
commit c95014bf29

3
.gitmodules vendored

@ -7,6 +7,3 @@
[submodule "lib/openzeppelin-contracts"] [submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts path = lib/openzeppelin-contracts
url = https://github.com/openzeppelin/openzeppelin-contracts url = https://github.com/openzeppelin/openzeppelin-contracts
[submodule "lib/erc721a"]
path = lib/erc721a
url = https://github.com/chiru-labs/erc721a

@ -1 +0,0 @@
Subproject commit b3ca8989411f717fac2d6a21a1c59ef05188907f

@ -1,12 +1,12 @@
// SPDX-License-Identifier: UNLICENSED // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13; pragma solidity ^0.8.13;
import {ERC721A} from "erc721a/ERC721A.sol"; import {ERC721} from "solmate/tokens/ERC721.sol";
import {Owned} from "solmate/auth/Owned.sol"; import {Owned} from "solmate/auth/Owned.sol";
import {LibString} from "solmate/utils/LibString.sol"; import {LibString} from "solmate/utils/LibString.sol";
import {Main} from "./Main.sol"; import {Main} from "./Main.sol";
contract Unaboomer is ERC721A, Owned { contract Unaboomer is ERC721, Owned {
using LibString for uint256; using LibString for uint256;
mapping(uint256 => bool) public tokenDead; mapping(uint256 => bool) public tokenDead;
@ -19,7 +19,7 @@ contract Unaboomer is ERC721A, Owned {
string public deadURI; string public deadURI;
Main public main; Main public main;
constructor() ERC721A("Unaboomer", "BOOMR") Owned(msg.sender) {} constructor() ERC721("Unaboomer", "BOOMR") Owned(msg.sender) {}
// ========================================================================= // =========================================================================
// Admin // Admin
@ -60,10 +60,18 @@ contract Unaboomer is ERC721A, Owned {
// Tokens // Tokens
// ========================================================================= // =========================================================================
/// Helper function to get supply minted
function totalSupply() public view returns (uint256) {
return minted;
}
/// Mint tokens from main contract /// Mint tokens from main contract
function radicalize(address _to, uint256 _amount) external payable onlyMain { function radicalize(address _to, uint256 _amount) external payable onlyMain {
require(totalSupply() + _amount <= MAX_SUPPLY, "supply reached"); require(totalSupply() + _amount <= MAX_SUPPLY, "supply reached");
_safeMint(_to, _amount); for (uint256 i; i < _amount; i++) {
_safeMint(_to, minted);
minted++;
}
} }
/// Toggle token state from living to dead /// Toggle token state from living to dead
@ -83,7 +91,7 @@ contract Unaboomer is ERC721A, Owned {
} }
} }
function supportsInterface(bytes4 interfaceId) public view virtual override (ERC721A) returns (bool) { function supportsInterface(bytes4 interfaceId) public view virtual override (ERC721) returns (bool) {
return super.supportsInterface(interfaceId); return super.supportsInterface(interfaceId);
} }
} }

@ -75,9 +75,9 @@ contract UnaboomerTest is Test {
function testSendingBombsAgain() public { function testSendingBombsAgain() public {
hoax(address(1)); hoax(address(1));
main.radicalizeBoomers{value: 99 ether}(9900); main.radicalizeBoomers{value: 10 ether}(1000);
hoax(address(1)); hoax(address(1));
main.sendBombs(15); main.sendBombs(10);
} }
function testKilling() public { function testKilling() public {

@ -3,3 +3,16 @@
export $(cat .env) export $(cat .env)
forge script script/Unaboomer.s.sol:DeployProject --private-key=$LOCAL_KEY --rpc-url http://localhost:8545 --broadcast forge script script/Unaboomer.s.sol:DeployProject --private-key=$LOCAL_KEY --rpc-url http://localhost:8545 --broadcast
cast send --private-key=$LOCAL_KEY --rpc-url=$LOCAL_RPC --value "10 ether" 0x653D2d1D10c79017b2eA5F5a6F02D9Ab6e725395 cast send --private-key=$LOCAL_KEY --rpc-url=$LOCAL_RPC --value "10 ether" 0x653D2d1D10c79017b2eA5F5a6F02D9Ab6e725395
# cast send --private-key=$LOCAL_KEY --rpc-url=$LOCAL_RPC 0x5FbDB2315678afecb367f032d93F642f64180aa3 "radicalizeBoomers(uint256)" 1000 --value "10 ether"
# cast send --private-key=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --rpc-url=$LOCAL_RPC 0x5FbDB2315678afecb367f032d93F642f64180aa3 "radicalizeBoomers(uint256)" 10 --value "0.1 ether"
# cast send --private-key=0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d --rpc-url=$LOCAL_RPC 0x5FbDB2315678afecb367f032d93F642f64180aa3 "radicalizeBoomers(uint256)" 10 --value "0.1 ether"
# cast send --private-key=0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a --rpc-url=$LOCAL_RPC 0x5FbDB2315678afecb367f032d93F642f64180aa3 "radicalizeBoomers(uint256)" 10 --value "0.1 ether"
# cast send --private-key=0x7c852118294e51e653712a81e05800f419141751be58f605c371e15141b007a6 --rpc-url=$LOCAL_RPC 0x5FbDB2315678afecb367f032d93F642f64180aa3 "radicalizeBoomers(uint256)" 10 --value "0.1 ether"
# cast send --private-key=0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a --rpc-url=$LOCAL_RPC 0x5FbDB2315678afecb367f032d93F642f64180aa3 "radicalizeBoomers(uint256)" 10 --value "0.1 ether"
# cast send --private-key=0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba --rpc-url=$LOCAL_RPC 0x5FbDB2315678afecb367f032d93F642f64180aa3 "radicalizeBoomers(uint256)" 10 --value "0.1 ether"
# cast send --private-key=0x92db14e403b83dfe3df233f83dfa3a0d7096f21ca9b0d6d6b8d88b2b4ec1564e --rpc-url=$LOCAL_RPC 0x5FbDB2315678afecb367f032d93F642f64180aa3 "radicalizeBoomers(uint256)" 10 --value "0.1 ether"
# cast send --private-key=0x4bbbf85ce3377467afe5d46f804f221813b2bb87f24d81f60f1fcdbf7cbf4356 --rpc-url=$LOCAL_RPC 0x5FbDB2315678afecb367f032d93F642f64180aa3 "radicalizeBoomers(uint256)" 10 --value "0.1 ether"
# cast send --private-key=0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97 --rpc-url=$LOCAL_RPC 0x5FbDB2315678afecb367f032d93F642f64180aa3 "radicalizeBoomers(uint256)" 10 --value "0.1 ether"
# cast send --private-key=0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6 --rpc-url=$LOCAL_RPC 0x5FbDB2315678afecb367f032d93F642f64180aa3 "radicalizeBoomers(uint256)" 10 --value "0.1 ether"

Loading…
Cancel
Save