From 48bb93dac1a5c7bbc74f61ce36a7d4831a5dc055 Mon Sep 17 00:00:00 2001 From: lza_menace Date: Thu, 22 Dec 2022 16:33:33 -0800 Subject: [PATCH] base --- .gitignore | 4 +++ .gitmodules | 3 +++ foundry.toml | 6 +++++ lib/forge-std | 1 + script/Counter.s.sol | 12 +++++++++ src/Counter.sol | 58 ++++++++++++++++++++++++++++++++++++++++++++ test/Counter.t.sol | 24 ++++++++++++++++++ 7 files changed, 108 insertions(+) create mode 100644 .gitignore create mode 100644 .gitmodules create mode 100644 foundry.toml create mode 160000 lib/forge-std create mode 100644 script/Counter.s.sol create mode 100644 src/Counter.sol create mode 100644 test/Counter.t.sol diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0f182bf --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +out +.env +.venv +lib \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..888d42d --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "lib/forge-std"] + path = lib/forge-std + url = https://github.com/foundry-rs/forge-std diff --git a/foundry.toml b/foundry.toml new file mode 100644 index 0000000..e6810b2 --- /dev/null +++ b/foundry.toml @@ -0,0 +1,6 @@ +[profile.default] +src = 'src' +out = 'out' +libs = ['lib'] + +# See more config options https://github.com/foundry-rs/foundry/tree/master/config \ No newline at end of file diff --git a/lib/forge-std b/lib/forge-std new file mode 160000 index 0000000..eb980e1 --- /dev/null +++ b/lib/forge-std @@ -0,0 +1 @@ +Subproject commit eb980e1d4f0e8173ec27da77297ae411840c8ccb diff --git a/script/Counter.s.sol b/script/Counter.s.sol new file mode 100644 index 0000000..0e546ab --- /dev/null +++ b/script/Counter.s.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.13; + +import "forge-std/Script.sol"; + +contract CounterScript is Script { + function setUp() public {} + + function run() public { + vm.broadcast(); + } +} diff --git a/src/Counter.sol b/src/Counter.sol new file mode 100644 index 0000000..b480ead --- /dev/null +++ b/src/Counter.sol @@ -0,0 +1,58 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.13; + +// .02 or something for a unabomber + 2 bombs +// unabomber alone is free +// bomb has a 20% failure rate, when burned bomb +// "explodes" a pfp by updating the img to an explosion over the pfp +// well if its random +// just have them burn it and if it blows up a pfp thats already blown up +// then bomb wasted +// might be more fun if its random +// rather than targetted +// cause then theres a chance u blow up your own +// if random, we just need to let them know which unaboomer the exploded +// cause thats a lot of the fun, knowing u blew up a rare +// etc. +// i think this time, learning from tulips, we need to push urgency +// 10days has none? +// maybe 3 days or 5 days? +// or just say fuck it and go promothean +// ppl keep buying bombs etc. +// 30K collection, free mint, .01 per bomb +// random "blow-up" +// last 100 unabombers +// get 25% of the contract funds +// that way we sell SHIT TONS of bombs +// the lower the number gets the more likely a bomb hits a blown-up pfp +// ie sell moar bombs +// or last 1K unabombers +// bombs sales halt after we hit 1k +// i think the logic here mite be to use your dual IPFS baseURI contract +// we can do onchain but simplest way would be 2 baseURIs, one of the unabombers non blown up +// and one with blown up +// i can even make a lvl of "rarity" to the explosions +// lol +// then burn envelop = update the base uri of a random tokenid +// if token id already on blown up unabomber +// bomb is a dud +// then no need to code a dud, duds will get more likely +// as more unabombers blown up +// so if u hit a rando tokenid thats already blown up = dud, u dont tell the user it hit an already blown up one +// ujust say BOMB WAS DUD +// cause unabomber mamed more ppl than killed its kinda funny he even mailed duds +// lul +// he was pissed his boms werent killin ppl fuckin psycho lul + + +contract Unaboomer { + uint256 public number; + + function setNumber(uint256 newNumber) public { + number = newNumber; + } + + function increment() public { + number++; + } +} diff --git a/test/Counter.t.sol b/test/Counter.t.sol new file mode 100644 index 0000000..30235e8 --- /dev/null +++ b/test/Counter.t.sol @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.13; + +import "forge-std/Test.sol"; +import "../src/Counter.sol"; + +contract CounterTest is Test { + Counter public counter; + + function setUp() public { + counter = new Counter(); + counter.setNumber(0); + } + + function testIncrement() public { + counter.increment(); + assertEq(counter.number(), 1); + } + + function testSetNumber(uint256 x) public { + counter.setNumber(x); + assertEq(counter.number(), x); + } +}