├── campaigns ├── learning-assembly │ ├── yul-basics │ │ ├── test │ │ │ ├── data │ │ │ │ ├── if.json │ │ │ │ ├── switch.json │ │ │ │ ├── for.json │ │ │ │ ├── arithmetic.json │ │ │ │ └── comparisons.json │ │ │ ├── hardhat │ │ │ │ ├── If.test.js │ │ │ │ ├── Arithmetic.test.js │ │ │ │ ├── Comparisons.test.js │ │ │ │ ├── For.test.js │ │ │ │ ├── Switch.test.js │ │ │ │ └── SafeMath.test.js │ │ │ └── foundry │ │ │ │ ├── Comparisons.3.t.sol │ │ │ │ ├── Arithmetic.2.t.sol │ │ │ │ ├── If.4.t.sol │ │ │ │ ├── For.6.t.sol │ │ │ │ └── Switch.5.t.sol │ │ ├── hardhat.config.js │ │ ├── files-to-test.json │ │ ├── foundry.toml │ │ └── contracts │ │ │ ├── Switch.sol │ │ │ ├── For.sol │ │ │ └── If.sol │ ├── calldata-manipulation │ │ ├── files-to-test.json │ │ ├── hardhat.config.js │ │ ├── test │ │ │ ├── hardhat │ │ │ │ ├── WhispersV1.test.js │ │ │ │ └── WhispersV2.test.js │ │ │ ├── foundry │ │ │ │ └── WhispersV1.2.t.sol │ │ │ └── data │ │ │ │ └── whispersV1.json │ │ ├── contracts │ │ │ ├── WhispersV2.sol │ │ │ └── WhispersV1.sol │ │ ├── foundry.toml │ │ └── package.json │ ├── yul-basics.zip │ ├── bits-and-bytes.zip │ ├── memory-manipulation.zip │ ├── calldata-manipulation.zip │ ├── memory-manipulation │ │ ├── files-to-test.json │ │ ├── test │ │ │ ├── hardhat │ │ │ │ ├── FreeMemoryPointer.test.js │ │ │ │ ├── DynamicArray.test.js │ │ │ │ └── MemoryLayout.test.js │ │ │ ├── data │ │ │ │ ├── freeMemoryPointer.json │ │ │ │ ├── dynamicArray.json │ │ │ │ └── memoryLayout.json │ │ │ └── foundry │ │ │ │ ├── FreeMemoryPointer.2.t.sol │ │ │ │ ├── DynamicArray.4.t.sol │ │ │ │ └── MemoryLayout.3.t.sol │ │ ├── hardhat.config.js │ │ ├── foundry.toml │ │ └── package.json │ └── bits-and-bytes │ │ ├── files-to-test.json │ │ ├── hardhat.config.js │ │ ├── test │ │ ├── hardhat │ │ │ ├── Masks.test.js │ │ │ ├── Scrambled.test.js │ │ │ ├── BitOperators.test.js │ │ │ └── MaskGenerator.test.js │ │ ├── data │ │ │ ├── scrambled.json │ │ │ └── maskGenerator.json │ │ └── foundry │ │ │ ├── Masks.2.t.sol │ │ │ ├── Scrambled.4.t.sol │ │ │ └── BitOperators.1.t.sol │ │ ├── contracts │ │ └── Scrambled.sol │ │ ├── foundry.toml │ │ └── package.json ├── standalone-quests │ ├── wtf-imps │ │ ├── files-to-test.json │ │ ├── contracts │ │ │ ├── Imp.sol │ │ │ ├── TrickyImp.sol │ │ │ └── test │ │ │ │ └── TestImp.sol │ │ ├── hardhat.config.js │ │ ├── test │ │ │ └── foundry │ │ │ │ └── TrickyImp.1.t.sol │ │ ├── package.json │ │ └── foundry.toml │ ├── merkle-proofs │ │ ├── files-to-test.json │ │ ├── hardhat.config.js │ │ ├── test │ │ │ ├── hardhat │ │ │ │ └── SacredTree2.test.js │ │ │ └── foundry │ │ │ │ ├── SacredTree.2.t.sol │ │ │ │ └── SacredTree.1.t.sol │ │ ├── foundry.toml │ │ ├── package.json │ │ └── contracts │ │ │ └── SacredTree.sol │ ├── setting-up │ │ ├── files-to-test.json │ │ ├── hardhat.config.js │ │ ├── contracts │ │ │ └── HelloGuardian.sol │ │ ├── package.json │ │ ├── foundry.toml │ │ └── test │ │ │ ├── foundry │ │ │ ├── HelloGuardian.3.t.sol │ │ │ └── Submission.4.t.sol │ │ │ └── hardhat │ │ │ ├── HelloGuardian.test.js │ │ │ └── Submission.test.js │ ├── unordered-key-set │ │ ├── files-to-test.json │ │ ├── contracts │ │ │ └── Crates.sol │ │ ├── test │ │ │ ├── hardhat │ │ │ │ ├── Crates1.test.js │ │ │ │ └── Crates2.test.js │ │ │ └── foundry │ │ │ │ ├── Crates.2.t.sol │ │ │ │ └── Crates.1.t.sol │ │ ├── foundry.toml │ │ ├── package.json │ │ └── hardhat.config.js │ ├── delegate-call-detection │ │ ├── files-to-test.json │ │ ├── hardhat.config.js │ │ ├── foundry.toml │ │ ├── contracts │ │ │ ├── Mind.sol │ │ │ └── test │ │ │ │ └── TestProbe.sol │ │ └── package.json │ ├── clone-factories │ │ ├── files-to-test.json │ │ ├── contracts │ │ │ ├── Elaine.sol │ │ │ ├── SpiritCat.sol │ │ │ └── test │ │ │ │ └── Token.sol │ │ ├── test │ │ │ ├── data │ │ │ │ └── catData.json │ │ │ ├── hardhat │ │ │ │ └── Elaine1.test.js │ │ │ └── foundry │ │ │ │ └── Elaine.1.t.sol │ │ ├── hardhat.config.js │ │ ├── foundry.toml │ │ └── package.json │ ├── hardhat-forking │ │ ├── files-to-test.json │ │ ├── hardhat.config.js │ │ ├── contracts │ │ │ ├── QuarryBase.sol │ │ │ ├── EmeraldQuarry.sol │ │ │ ├── RockQuarry.sol │ │ │ └── RubyQuarry.sol │ │ ├── test │ │ │ └── foundry │ │ │ │ ├── EmeraldQuarry.2.t.sol │ │ │ │ ├── RockQuarry.1.t.sol │ │ │ │ └── RubyQuarry.3.t.sol │ │ └── foundry.toml │ ├── multicall │ │ ├── files-to-test.json │ │ ├── hardhat.config.js │ │ ├── test │ │ │ ├── hardhat │ │ │ │ ├── Multicall.test.js │ │ │ │ └── GreatScribe.test.js │ │ │ └── foundry │ │ │ │ ├── Multicall.2.t.sol │ │ │ │ └── GreatScribe.1.t.sol │ │ ├── foundry.toml │ │ ├── package.json │ │ └── contracts │ │ │ └── Multicall.sol │ ├── state-channels │ │ ├── files-to-test.json │ │ ├── hardhat.config.js │ │ ├── contracts │ │ │ ├── PaymentChannel.sol │ │ │ └── MineCart.sol │ │ ├── test │ │ │ ├── hardhat │ │ │ │ ├── MineCart.test.js │ │ │ │ └── PaymentChannel.test.js │ │ │ ├── data │ │ │ │ ├── mineCart.json │ │ │ │ └── paymentChannel.json │ │ │ └── foundry │ │ │ │ └── MineCart.2.t.sol │ │ ├── foundry.toml │ │ └── package.json │ ├── unexpected-ether │ │ ├── files-to-test.json │ │ ├── hardhat.config.js │ │ ├── foundry.toml │ │ ├── package.json │ │ └── contracts │ │ │ └── Attacker.sol │ ├── elliptic-curve │ │ ├── files-to-test.json │ │ ├── test │ │ │ ├── hardhat │ │ │ │ ├── FieldElement.test.js │ │ │ │ └── EllipticCurve.test.js │ │ │ └── foundry │ │ │ │ ├── FieldElement.1.t.sol │ │ │ │ └── CurveOperations.2.t.sol │ │ ├── hardhat.config.js │ │ ├── foundry.toml │ │ └── package.json │ ├── multicall.zip │ ├── wtf-imps.zip │ ├── price-oracle-attack │ │ ├── files-to-test.json │ │ ├── foundry.toml │ │ ├── hardhat.config.js │ │ └── package.json │ ├── setting-up.zip │ ├── stealth-addresses │ │ ├── files-to-test.json │ │ ├── hardhat.config.js │ │ ├── input │ │ │ └── stealthTransfer.json │ │ ├── test │ │ │ ├── hardhat │ │ │ │ └── CursedGrimoires.test.js │ │ │ └── foundry │ │ │ │ └── CursedGrimoires.2.t.sol │ │ ├── contracts │ │ │ └── CursedGrimoires.sol │ │ └── foundry.toml │ ├── elliptic-curve.zip │ ├── merkle-proofs.zip │ ├── quadratic-public-goods │ │ ├── files-to-test.json │ │ ├── contracts │ │ │ ├── VillageFunding.sol │ │ │ ├── VillageVoting.sol │ │ │ └── test │ │ │ │ └── ReentrancyAttacker.sol │ │ ├── hardhat.config.js │ │ ├── test │ │ │ ├── hardhat │ │ │ │ ├── VillageVoting.test.js │ │ │ │ └── VillageFunding.test.js │ │ │ └── foundry │ │ │ │ ├── VillageVoting.1.t.sol │ │ │ │ └── VillageFunding.2.t.sol │ │ ├── foundry.toml │ │ └── package.json │ ├── state-channels.zip │ ├── vanity-theft.zip │ ├── clone-factories.zip │ ├── hardhat-forking.zip │ ├── low-level-calls.zip │ ├── self-hosted-evm.zip │ ├── unexpected-ether.zip │ ├── using-signatures.zip │ ├── celestia-blobstream.zip │ ├── finding-ouroboros.zip │ ├── price-oracle-attack.zip │ ├── stealth-addresses.zip │ ├── unordered-key-set.zip │ ├── bypassing-extcodesize.zip │ ├── emergency-governance.zip │ ├── static-call-detection.zip │ ├── using-signatures │ │ ├── files-to-test.json │ │ ├── hardhat.config.js │ │ ├── foundry.toml │ │ ├── test │ │ │ └── hardhat │ │ │ │ └── Grandmasters.test.js │ │ ├── contracts │ │ │ └── Grandmasters.sol │ │ └── package.json │ ├── delegate-call-detection.zip │ ├── flashloan-counterexploit.zip │ ├── interactive-fraud-proofs.zip │ ├── quadratic-public-goods.zip │ ├── self-hosted-evm │ │ ├── test │ │ │ ├── foundry │ │ │ │ ├── Stack.2.t.sol │ │ │ │ ├── Memory.3.t.sol │ │ │ │ ├── Create-Create2.7.t.sol │ │ │ │ ├── Call-StaticCall.5.t.sol │ │ │ │ ├── DelegateCall-CallCode.6.t.sol │ │ │ │ └── Instructions.4.t.sol │ │ │ └── hardhat │ │ │ │ ├── Stack.test.js │ │ │ │ ├── Memory.test.js │ │ │ │ ├── Instructions.test.js │ │ │ │ ├── Create-Create2.test.js │ │ │ │ ├── Call-StaticCall.test.js │ │ │ │ └── DelegateCall-CallCode.test.js │ │ ├── files-to-test.json │ │ ├── contracts │ │ │ ├── libraries │ │ │ │ └── Account.sol │ │ │ └── test │ │ │ │ └── helpers │ │ │ │ ├── CreatedNoParams.sol │ │ │ │ ├── CreatedParams.sol │ │ │ │ ├── Create.sol │ │ │ │ └── Create2.sol │ │ ├── package.json │ │ ├── foundry.toml │ │ └── hardhat.config.js │ ├── bypassing-extcodesize │ │ ├── contracts_ │ │ │ └── interfaces │ │ │ │ └── IChallenger.sol │ │ ├── foundry.toml │ │ ├── hardhat.config.js │ │ └── package.json │ ├── celestia-blobstream │ │ ├── contracts_ │ │ │ └── interfaces │ │ │ │ └── IObservatory.sol │ │ ├── foundry.toml │ │ ├── package.json │ │ └── hardhat.config.js │ ├── low-level-calls │ │ ├── contracts_ │ │ │ └── Farm2.sol │ │ ├── foundry.toml │ │ ├── package.json │ │ └── hardhat.config.js │ ├── vanity-theft │ │ ├── contracts_ │ │ │ └── Loot.sol │ │ ├── foundry.toml │ │ ├── package.json │ │ └── hardhat.config.js │ ├── static-call-detection │ │ ├── foundry.toml │ │ ├── hardhat.config.js │ │ └── package.json │ ├── emergency-governance │ │ ├── foundry.toml │ │ ├── hardhat.config.js │ │ └── package.json │ ├── flashloan-counterexploit │ │ ├── foundry.toml │ │ ├── hardhat.config.js │ │ └── package.json │ ├── interactive-fraud-proofs │ │ ├── foundry.toml │ │ ├── package.json │ │ └── hardhat.config.js │ └── finding-ouroboros │ │ ├── foundry.toml │ │ ├── package.json │ │ └── hardhat.config.js ├── diamonds │ ├── stateful-libraries │ │ ├── files-to-test.json │ │ ├── test │ │ │ ├── hardhat │ │ │ │ └── LibMap.test.js │ │ │ └── foundry │ │ │ │ └── LibMap.1.t.sol │ │ ├── hardhat.config.js │ │ ├── foundry.toml │ │ └── package.json │ ├── using-diamonds.zip │ ├── building-diamonds.zip │ ├── stateful-libraries.zip │ ├── building-diamonds │ │ ├── hardhat.config.js │ │ ├── files-to-test.json │ │ ├── foundry.toml │ │ ├── package.json │ │ └── contracts │ │ │ └── facets │ │ │ └── OwnershipFacet.sol │ └── using-diamonds │ │ ├── foundry.toml │ │ └── package.json ├── gas-golfing-s1 │ ├── changing-base │ │ ├── files-to-test.json │ │ ├── hardhat.config.js │ │ ├── foundry.toml │ │ └── package.json │ ├── remove-duplicates │ │ ├── files-to-test.json │ │ ├── hardhat.config.js │ │ ├── contracts │ │ │ └── Challenge.sol │ │ ├── foundry.toml │ │ ├── package.json │ │ └── test │ │ │ └── hardhat │ │ │ └── Challenge1.test.js │ ├── roman-numerals │ │ ├── files-to-test.json │ │ ├── hardhat.config.js │ │ ├── contracts │ │ │ └── Challenge.sol │ │ ├── foundry.toml │ │ ├── package.json │ │ └── test │ │ │ └── hardhat │ │ │ └── Challenge.test.js │ ├── internal-representation │ │ ├── files-to-test.json │ │ ├── hardhat.config.js │ │ ├── foundry.toml │ │ ├── package.json │ │ └── test │ │ │ └── hardhat │ │ │ └── Challenge.test.js │ ├── changing-base.zip │ ├── roman-numerals.zip │ ├── remove-duplicates.zip │ └── internal-representation.zip ├── gas-optimization │ ├── assembly-optimization │ │ ├── files-to-test.json │ │ ├── hardhat.config.js │ │ ├── foundry.toml │ │ ├── package.json │ │ ├── contracts │ │ │ └── Challenge.sol │ │ └── test │ │ │ └── hardhat │ │ │ └── Challenge.test.js │ ├── solidity-optimization │ │ ├── files-to-test.json │ │ ├── foundry.toml │ │ ├── hardhat.config.js │ │ └── package.json │ ├── assembly-optimization.zip │ └── solidity-optimization.zip ├── building-on-zksync │ ├── zksync-accounts │ │ ├── files-to-test.json │ │ ├── .gitignore │ │ ├── test │ │ │ ├── data │ │ │ │ └── inputs.json │ │ │ └── SummonerAccount.test.js │ │ ├── contracts │ │ │ ├── SummonerAccount.sol │ │ │ └── test │ │ │ │ └── Box.sol │ │ └── hardhat.config.js │ ├── zksync-paymasters │ │ ├── files-to-test.json │ │ ├── .gitignore │ │ ├── contracts │ │ │ ├── LunarPaymaster.sol │ │ │ └── test │ │ │ │ └── Box.sol │ │ ├── test │ │ │ ├── LunarPaymaster.test.js │ │ │ └── data │ │ │ │ └── inputs.json │ │ └── hardhat.config.js │ ├── zksync-contracts │ │ ├── .gitignore │ │ ├── files-to-test.json │ │ ├── contracts │ │ │ ├── Claws.sol │ │ │ ├── test │ │ │ │ ├── Sound.sol │ │ │ │ ├── Ally.sol │ │ │ │ └── Enemy.sol │ │ │ ├── Senses.sol │ │ │ └── Lungs.sol │ │ ├── test │ │ │ └── Lungs.test.js │ │ └── hardhat.config.js │ ├── zksync-accounts.zip │ ├── zksync-contracts.zip │ └── zksync-paymasters.zip ├── proxy-contracts │ ├── basic-proxies │ │ ├── files-to-test.json │ │ ├── hardhat.config.js │ │ ├── foundry.toml │ │ ├── package.json │ │ └── contracts │ │ │ ├── UpgradeableMechSuit.sol │ │ │ ├── MechSuitV1.sol │ │ │ └── MechSuitV2.sol │ ├── basic-proxies.zip │ ├── openzeppelin-upgrades │ │ ├── files-to-test.json │ │ └── hardhat.config.js │ ├── proxy-security.zip │ ├── openzeppelin-upgrades.zip │ └── proxy-security │ │ ├── foundry.toml │ │ ├── package.json │ │ └── hardhat.config.js ├── token-standards │ ├── building-erc-721 │ │ ├── test │ │ │ ├── data │ │ │ │ ├── amuletTransfer.json │ │ │ │ ├── amuletCreation.json │ │ │ │ └── amuletPouch.json │ │ │ ├── hardhat │ │ │ │ ├── AmuletPouch.test.js │ │ │ │ ├── AmuletCreation.test.js │ │ │ │ └── AmuletTransfer.test.js │ │ │ └── foundry │ │ │ │ ├── AmuletPouch.4.t.sol │ │ │ │ ├── AmuletCreation.2.t.sol │ │ │ │ └── AmuletTransfer.3.t.sol │ │ ├── files-to-test.json │ │ ├── hardhat.config.js │ │ ├── contracts │ │ │ ├── AmuletPouch.sol │ │ │ ├── Amulet.sol │ │ │ └── interfaces │ │ │ │ └── IERC165.sol │ │ ├── foundry.toml │ │ └── package.json │ ├── building-erc-20 │ │ ├── files-to-test.json │ │ ├── test │ │ │ ├── data │ │ │ │ ├── doubloonCreation.json │ │ │ │ ├── mintableDoubloon.json │ │ │ │ └── doubloonTransfer.json │ │ │ ├── hardhat │ │ │ │ ├── DoubloonEvents.test.js │ │ │ │ ├── DoubloonCreation.test.js │ │ │ │ ├── DoubloonTransfer.test.js │ │ │ │ └── MintableDoubloon.test.js │ │ │ └── foundry │ │ │ │ ├── DoubloonEvents.4.t.sol │ │ │ │ ├── DoubloonCreation.2.t.sol │ │ │ │ ├── DoubloonTransfer.3.t.sol │ │ │ │ └── MintableDoubloon.5.t.sol │ │ ├── hardhat.config.js │ │ ├── contracts │ │ │ ├── MintableDoubloon.sol │ │ │ └── Doubloon.sol │ │ ├── foundry.toml │ │ └── package.json │ ├── building-erc-20.zip │ └── building-erc-721.zip ├── get-rekt │ ├── cream-rekt.zip │ ├── poly-rekt.zip │ ├── wintermute-rekt.zip │ ├── wintermute-rekt │ │ ├── necromancy-spells │ │ │ └── find-more-dead.png │ │ ├── foundry.toml │ │ └── hardhat.config.js │ ├── cream-rekt │ │ ├── foundry.toml │ │ └── hardhat.config.js │ └── poly-rekt │ │ └── foundry.toml ├── randomness │ ├── breaking-rng.zip │ ├── chainlink-vrf.zip │ ├── breaking-rng │ │ ├── contracts_ │ │ │ └── Shadeling.sol │ │ ├── foundry.toml │ │ ├── package.json │ │ └── hardhat.config.js │ └── chainlink-vrf │ │ ├── foundry.toml │ │ └── hardhat.config.js ├── understanding-storage │ ├── storage-efficiency │ │ ├── files-to-test.json │ │ ├── test │ │ │ ├── hardhat │ │ │ │ ├── Elegy1.test.js │ │ │ │ └── Elegy2.test.js │ │ │ ├── foundry │ │ │ │ ├── Elegy.1.t.sol │ │ │ │ └── Elegy.2.t.sol │ │ │ └── data │ │ │ │ ├── verses.json │ │ │ │ └── songs.json │ │ ├── foundry.toml │ │ ├── hardhat.config.js │ │ ├── contracts │ │ │ └── Elegy2.sol │ │ └── package.json │ ├── storage-layout.zip │ ├── storage-efficiency.zip │ └── storage-layout │ │ ├── foundry.toml │ │ ├── contracts_ │ │ └── Temple.sol │ │ ├── package.json │ │ └── hardhat.config.js └── playing-with-op-stack │ ├── create-op-rollup.zip │ ├── cross-layer-secrets.zip │ ├── create-op-rollup │ ├── package.json │ ├── foundry.toml │ └── hardhat.config.js │ └── cross-layer-secrets │ └── foundry.toml ├── remappings.txt └── commitlint.config.js /campaigns/learning-assembly/yul-basics/test/data/if.json: -------------------------------------------------------------------------------- 1 | [ 60, 1 ] -------------------------------------------------------------------------------- /remappings.txt: -------------------------------------------------------------------------------- 1 | ds-test/=lib/forge-std/lib/ds-test/src/ 2 | forge-std/=lib/forge-std/src/ -------------------------------------------------------------------------------- /campaigns/standalone-quests/wtf-imps/files-to-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | "contracts/Imp.sol" 3 | ] -------------------------------------------------------------------------------- /campaigns/diamonds/stateful-libraries/files-to-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | "contracts/LibMap.sol" 3 | ] -------------------------------------------------------------------------------- /campaigns/gas-golfing-s1/changing-base/files-to-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | "contracts/Challenge.sol" 3 | ] -------------------------------------------------------------------------------- /commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['@commitlint/config-conventional'], 3 | } -------------------------------------------------------------------------------- /campaigns/gas-golfing-s1/remove-duplicates/files-to-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | "contracts/Challenge.sol" 3 | ] -------------------------------------------------------------------------------- /campaigns/gas-golfing-s1/roman-numerals/files-to-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | "contracts/Challenge.sol" 3 | ] -------------------------------------------------------------------------------- /campaigns/standalone-quests/merkle-proofs/files-to-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | "contracts/SacredTree.sol" 3 | ] -------------------------------------------------------------------------------- /campaigns/standalone-quests/setting-up/files-to-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | "contracts/HelloGuardian.sol" 3 | ] -------------------------------------------------------------------------------- /campaigns/standalone-quests/unordered-key-set/files-to-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | "contracts/Crates.sol" 3 | ] -------------------------------------------------------------------------------- /campaigns/gas-golfing-s1/internal-representation/files-to-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | "contracts/Challenge.sol" 3 | ] -------------------------------------------------------------------------------- /campaigns/gas-optimization/assembly-optimization/files-to-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | "contracts/Challenge.sol" 3 | ] -------------------------------------------------------------------------------- /campaigns/gas-optimization/solidity-optimization/files-to-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | "contracts/Challenge.sol" 3 | ] -------------------------------------------------------------------------------- /campaigns/standalone-quests/delegate-call-detection/files-to-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | "contracts/Mind.sol" 3 | ] -------------------------------------------------------------------------------- /campaigns/building-on-zksync/zksync-accounts/files-to-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | "contracts/SummonerAccount.sol" 3 | ] -------------------------------------------------------------------------------- /campaigns/building-on-zksync/zksync-paymasters/files-to-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | "contracts/LunarPaymaster.sol" 3 | ] -------------------------------------------------------------------------------- /campaigns/proxy-contracts/basic-proxies/files-to-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | "contracts/UpgradeableMechSuit.sol" 3 | ] -------------------------------------------------------------------------------- /campaigns/learning-assembly/yul-basics/test/data/switch.json: -------------------------------------------------------------------------------- 1 | [ 2 | [0, 1, 2, 3], 3 | [28, 65, 130, 7] 4 | ] -------------------------------------------------------------------------------- /campaigns/building-on-zksync/zksync-accounts/.gitignore: -------------------------------------------------------------------------------- 1 | artifacts-zk 2 | cache-zk 3 | deployments-zk 4 | era_test_node.log -------------------------------------------------------------------------------- /campaigns/building-on-zksync/zksync-contracts/.gitignore: -------------------------------------------------------------------------------- 1 | artifacts-zk 2 | cache-zk 3 | deployments-zk 4 | era_test_node.log -------------------------------------------------------------------------------- /campaigns/building-on-zksync/zksync-paymasters/.gitignore: -------------------------------------------------------------------------------- 1 | artifacts-zk 2 | cache-zk 3 | deployments-zk 4 | era_test_node.log -------------------------------------------------------------------------------- /campaigns/learning-assembly/yul-basics/test/data/for.json: -------------------------------------------------------------------------------- 1 | [ 2 | {"beg": 4, "end": 37}, 3 | {"beg": 11, "end": 11} 4 | ] -------------------------------------------------------------------------------- /campaigns/token-standards/building-erc-721/test/data/amuletTransfer.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "startId": 2 4 | } 5 | ] -------------------------------------------------------------------------------- /campaigns/get-rekt/cream-rekt.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/get-rekt/cream-rekt.zip -------------------------------------------------------------------------------- /campaigns/get-rekt/poly-rekt.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/get-rekt/poly-rekt.zip -------------------------------------------------------------------------------- /campaigns/standalone-quests/clone-factories/files-to-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | "contracts/Elaine.sol", 3 | "contracts/SpiritCat.sol" 4 | ] -------------------------------------------------------------------------------- /campaigns/standalone-quests/hardhat-forking/files-to-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | "contracts/QuarryBase.sol", 3 | "output/treasure.json" 4 | ] -------------------------------------------------------------------------------- /campaigns/standalone-quests/multicall/files-to-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | "contracts/GreatScribe.sol", 3 | "contracts/Multicall.sol" 4 | ] -------------------------------------------------------------------------------- /campaigns/token-standards/building-erc-721/files-to-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | "contracts/Amulet.sol", 3 | "contracts/AmuletPouch.sol" 4 | ] -------------------------------------------------------------------------------- /campaigns/diamonds/using-diamonds.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/diamonds/using-diamonds.zip -------------------------------------------------------------------------------- /campaigns/get-rekt/wintermute-rekt.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/get-rekt/wintermute-rekt.zip -------------------------------------------------------------------------------- /campaigns/randomness/breaking-rng.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/randomness/breaking-rng.zip -------------------------------------------------------------------------------- /campaigns/randomness/chainlink-vrf.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/randomness/chainlink-vrf.zip -------------------------------------------------------------------------------- /campaigns/standalone-quests/state-channels/files-to-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | "contracts/PaymentChannel.sol", 3 | "contracts/MineCart.sol" 4 | ] -------------------------------------------------------------------------------- /campaigns/standalone-quests/unexpected-ether/files-to-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | "contracts/Attacker.sol", 3 | "contracts/SimpleGameV2.sol" 4 | ] -------------------------------------------------------------------------------- /campaigns/token-standards/building-erc-20/files-to-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | "contracts/Doubloon.sol", 3 | "contracts/MintableDoubloon.sol" 4 | ] -------------------------------------------------------------------------------- /campaigns/token-standards/building-erc-721/test/data/amuletCreation.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "uri": "https://sampleuri1.com" 4 | } 5 | ] -------------------------------------------------------------------------------- /campaigns/understanding-storage/storage-efficiency/files-to-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | "contracts/Elegy1.sol", 3 | "contracts/Elegy2.sol" 4 | ] -------------------------------------------------------------------------------- /campaigns/diamonds/building-diamonds.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/diamonds/building-diamonds.zip -------------------------------------------------------------------------------- /campaigns/diamonds/stateful-libraries.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/diamonds/stateful-libraries.zip -------------------------------------------------------------------------------- /campaigns/learning-assembly/calldata-manipulation/files-to-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | "contracts/WhispersV1.sol", 3 | "contracts/WhispersV2.sol" 4 | ] -------------------------------------------------------------------------------- /campaigns/standalone-quests/elliptic-curve/files-to-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | "contracts/FieldElement.sol", 3 | "contracts/EllipticCurve.sol" 4 | ] -------------------------------------------------------------------------------- /campaigns/standalone-quests/multicall.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/standalone-quests/multicall.zip -------------------------------------------------------------------------------- /campaigns/standalone-quests/wtf-imps.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/standalone-quests/wtf-imps.zip -------------------------------------------------------------------------------- /campaigns/gas-golfing-s1/changing-base.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/gas-golfing-s1/changing-base.zip -------------------------------------------------------------------------------- /campaigns/gas-golfing-s1/roman-numerals.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/gas-golfing-s1/roman-numerals.zip -------------------------------------------------------------------------------- /campaigns/learning-assembly/yul-basics.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/learning-assembly/yul-basics.zip -------------------------------------------------------------------------------- /campaigns/proxy-contracts/basic-proxies.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/proxy-contracts/basic-proxies.zip -------------------------------------------------------------------------------- /campaigns/proxy-contracts/openzeppelin-upgrades/files-to-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | "contracts/UltimateSuitV1.sol", 3 | "contracts/UltimateSuitV2.sol" 4 | ] -------------------------------------------------------------------------------- /campaigns/standalone-quests/price-oracle-attack/files-to-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | "contracts/GreatScribe.sol", 3 | "contracts/GreaterArchives.sol" 4 | ] -------------------------------------------------------------------------------- /campaigns/standalone-quests/setting-up.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/standalone-quests/setting-up.zip -------------------------------------------------------------------------------- /campaigns/standalone-quests/stealth-addresses/files-to-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | "contracts/CursedGrimoires.sol", 3 | "output/stealthRecipient.json" 4 | ] -------------------------------------------------------------------------------- /campaigns/gas-golfing-s1/remove-duplicates.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/gas-golfing-s1/remove-duplicates.zip -------------------------------------------------------------------------------- /campaigns/learning-assembly/bits-and-bytes.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/learning-assembly/bits-and-bytes.zip -------------------------------------------------------------------------------- /campaigns/proxy-contracts/proxy-security.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/proxy-contracts/proxy-security.zip -------------------------------------------------------------------------------- /campaigns/standalone-quests/elliptic-curve.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/standalone-quests/elliptic-curve.zip -------------------------------------------------------------------------------- /campaigns/standalone-quests/merkle-proofs.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/standalone-quests/merkle-proofs.zip -------------------------------------------------------------------------------- /campaigns/standalone-quests/quadratic-public-goods/files-to-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | "contracts/VillageVoting.sol", 3 | "contracts/VillageFunding.sol" 4 | ] -------------------------------------------------------------------------------- /campaigns/standalone-quests/state-channels.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/standalone-quests/state-channels.zip -------------------------------------------------------------------------------- /campaigns/standalone-quests/vanity-theft.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/standalone-quests/vanity-theft.zip -------------------------------------------------------------------------------- /campaigns/token-standards/building-erc-20.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/token-standards/building-erc-20.zip -------------------------------------------------------------------------------- /campaigns/token-standards/building-erc-721.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/token-standards/building-erc-721.zip -------------------------------------------------------------------------------- /campaigns/building-on-zksync/zksync-accounts.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/building-on-zksync/zksync-accounts.zip -------------------------------------------------------------------------------- /campaigns/standalone-quests/clone-factories.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/standalone-quests/clone-factories.zip -------------------------------------------------------------------------------- /campaigns/standalone-quests/hardhat-forking.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/standalone-quests/hardhat-forking.zip -------------------------------------------------------------------------------- /campaigns/standalone-quests/low-level-calls.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/standalone-quests/low-level-calls.zip -------------------------------------------------------------------------------- /campaigns/standalone-quests/self-hosted-evm.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/standalone-quests/self-hosted-evm.zip -------------------------------------------------------------------------------- /campaigns/standalone-quests/unexpected-ether.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/standalone-quests/unexpected-ether.zip -------------------------------------------------------------------------------- /campaigns/standalone-quests/using-signatures.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/standalone-quests/using-signatures.zip -------------------------------------------------------------------------------- /campaigns/building-on-zksync/zksync-contracts.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/building-on-zksync/zksync-contracts.zip -------------------------------------------------------------------------------- /campaigns/building-on-zksync/zksync-contracts/files-to-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | "contracts/Claws.sol", 3 | "contracts/Senses.sol", 4 | "contracts/Lungs.sol" 5 | ] -------------------------------------------------------------------------------- /campaigns/building-on-zksync/zksync-paymasters.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/building-on-zksync/zksync-paymasters.zip -------------------------------------------------------------------------------- /campaigns/learning-assembly/memory-manipulation.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/learning-assembly/memory-manipulation.zip -------------------------------------------------------------------------------- /campaigns/proxy-contracts/openzeppelin-upgrades.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/proxy-contracts/openzeppelin-upgrades.zip -------------------------------------------------------------------------------- /campaigns/standalone-quests/celestia-blobstream.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/standalone-quests/celestia-blobstream.zip -------------------------------------------------------------------------------- /campaigns/standalone-quests/finding-ouroboros.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/standalone-quests/finding-ouroboros.zip -------------------------------------------------------------------------------- /campaigns/standalone-quests/price-oracle-attack.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/standalone-quests/price-oracle-attack.zip -------------------------------------------------------------------------------- /campaigns/standalone-quests/stealth-addresses.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/standalone-quests/stealth-addresses.zip -------------------------------------------------------------------------------- /campaigns/standalone-quests/unordered-key-set.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/standalone-quests/unordered-key-set.zip -------------------------------------------------------------------------------- /campaigns/understanding-storage/storage-layout.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/understanding-storage/storage-layout.zip -------------------------------------------------------------------------------- /campaigns/gas-golfing-s1/internal-representation.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/gas-golfing-s1/internal-representation.zip -------------------------------------------------------------------------------- /campaigns/gas-optimization/assembly-optimization.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/gas-optimization/assembly-optimization.zip -------------------------------------------------------------------------------- /campaigns/gas-optimization/solidity-optimization.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/gas-optimization/solidity-optimization.zip -------------------------------------------------------------------------------- /campaigns/learning-assembly/calldata-manipulation.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/learning-assembly/calldata-manipulation.zip -------------------------------------------------------------------------------- /campaigns/playing-with-op-stack/create-op-rollup.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/playing-with-op-stack/create-op-rollup.zip -------------------------------------------------------------------------------- /campaigns/standalone-quests/bypassing-extcodesize.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/standalone-quests/bypassing-extcodesize.zip -------------------------------------------------------------------------------- /campaigns/standalone-quests/emergency-governance.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/standalone-quests/emergency-governance.zip -------------------------------------------------------------------------------- /campaigns/standalone-quests/static-call-detection.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/standalone-quests/static-call-detection.zip -------------------------------------------------------------------------------- /campaigns/standalone-quests/using-signatures/files-to-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | "contracts/Grandmasters.sol", 3 | "output/invites.json", 4 | "output/blessings.json" 5 | ] -------------------------------------------------------------------------------- /campaigns/token-standards/building-erc-20/test/data/doubloonCreation.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "supply": 1000 4 | }, 5 | { 6 | "supply": 10 7 | } 8 | ] -------------------------------------------------------------------------------- /campaigns/playing-with-op-stack/cross-layer-secrets.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/playing-with-op-stack/cross-layer-secrets.zip -------------------------------------------------------------------------------- /campaigns/standalone-quests/delegate-call-detection.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/standalone-quests/delegate-call-detection.zip -------------------------------------------------------------------------------- /campaigns/standalone-quests/flashloan-counterexploit.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/standalone-quests/flashloan-counterexploit.zip -------------------------------------------------------------------------------- /campaigns/standalone-quests/interactive-fraud-proofs.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/standalone-quests/interactive-fraud-proofs.zip -------------------------------------------------------------------------------- /campaigns/standalone-quests/quadratic-public-goods.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/standalone-quests/quadratic-public-goods.zip -------------------------------------------------------------------------------- /campaigns/understanding-storage/storage-efficiency.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/understanding-storage/storage-efficiency.zip -------------------------------------------------------------------------------- /campaigns/learning-assembly/memory-manipulation/files-to-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | "contracts/DynamicArray.sol", 3 | "contracts/FreeMemoryPointer.sol", 4 | "contracts/MemoryLayout.sol" 5 | ] -------------------------------------------------------------------------------- /campaigns/building-on-zksync/zksync-contracts/contracts/Claws.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | contract Claws { 5 | // TODO: Complete this contract 6 | } -------------------------------------------------------------------------------- /campaigns/building-on-zksync/zksync-accounts/test/data/inputs.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "salt": "0x52ab08b50eaac6b4ec541cabfdd5cd2f4fedc8411080346570bee37b933a63e4", 4 | "seed": 10 5 | } 6 | ] -------------------------------------------------------------------------------- /campaigns/get-rekt/wintermute-rekt/necromancy-spells/find-more-dead.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nodeguardians/ng-quests-public/HEAD/campaigns/get-rekt/wintermute-rekt/necromancy-spells/find-more-dead.png -------------------------------------------------------------------------------- /campaigns/learning-assembly/bits-and-bytes/files-to-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | "contracts/BitOperators.sol", 3 | "contracts/MaskGenerator.sol", 4 | "contracts/Masks.sol", 5 | "contracts/Scrambled.sol" 6 | ] -------------------------------------------------------------------------------- /campaigns/learning-assembly/bits-and-bytes/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomiclabs/hardhat-ethers"); 2 | require("@nomicfoundation/hardhat-chai-matchers"); 3 | module.exports = { 4 | solidity: "0.8.19", 5 | }; 6 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/clone-factories/contracts/Elaine.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./Summoner.sol"; 5 | 6 | contract Elaine is Summoner { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /campaigns/learning-assembly/yul-basics/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomiclabs/hardhat-ethers"); 2 | require("@nomicfoundation/hardhat-chai-matchers"); 3 | 4 | module.exports = { 5 | solidity: "0.8.19", 6 | }; 7 | -------------------------------------------------------------------------------- /campaigns/building-on-zksync/zksync-contracts/test/Lungs.test.js: -------------------------------------------------------------------------------- 1 | const { testLungs } = require("./testsuites/TestLungs.js"); 2 | 3 | describe("Lungs (Part 3)", function() { 4 | testLungs("Public Test 1", "Sound"); 5 | }); 6 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/self-hosted-evm/test/foundry/Stack.2.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./testsuites/TestStack.sol"; 5 | 6 | contract PublicTest1 is TestStack {} 7 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/self-hosted-evm/test/hardhat/Stack.test.js: -------------------------------------------------------------------------------- 1 | const { testStack } = require("./testsuites/TestStack.js"); 2 | 3 | describe("Stack (Part 2)", function () { 4 | testStack(`Public Test 1`); 5 | }); 6 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/clone-factories/test/data/catData.json: -------------------------------------------------------------------------------- 1 | { 2 | "amount": 1000000000000000000, 3 | "divisions": 4, 4 | "duration": 10000000, 5 | "recipient": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" 6 | } -------------------------------------------------------------------------------- /campaigns/standalone-quests/self-hosted-evm/files-to-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | "contracts/sEVM.sol", 3 | "contracts/libraries/Instructions.sol", 4 | "contracts/libraries/Stack.sol", 5 | "contracts/libraries/Memory.sol" 6 | ] -------------------------------------------------------------------------------- /campaigns/standalone-quests/self-hosted-evm/test/foundry/Memory.3.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./testsuites/TestMemory.sol"; 5 | 6 | contract PublicTest1 is TestMemory {} 7 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/self-hosted-evm/test/hardhat/Memory.test.js: -------------------------------------------------------------------------------- 1 | const { testMemory } = require("./testsuites/TestMemory.js"); 2 | 3 | describe("Memory (Part 3)", function () { 4 | testMemory(`Public Test 1`); 5 | }); 6 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/unordered-key-set/contracts/Crates.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import './interfaces/ICrates.sol'; 5 | 6 | contract Crates is ICrates { 7 | // CODE HERE 8 | } -------------------------------------------------------------------------------- /campaigns/token-standards/building-erc-20/test/data/mintableDoubloon.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "mintAmount": 100, 4 | "supply": 1000 5 | }, 6 | { 7 | "mintAmount": 150000, 8 | "supply": 100 9 | } 10 | ] -------------------------------------------------------------------------------- /campaigns/learning-assembly/yul-basics/files-to-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | "contracts/Arithmetic.sol", 3 | "contracts/Comparisons.sol", 4 | "contracts/For.sol", 5 | "contracts/If.sol", 6 | "contracts/SafeMath.sol", 7 | "contracts/Switch.sol" 8 | ] -------------------------------------------------------------------------------- /campaigns/building-on-zksync/zksync-contracts/contracts/test/Sound.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | /// @notice A contract to be deployed by `Lungs`. 5 | contract Sound { 6 | 7 | uint256 public decibels = 120; 8 | 9 | } -------------------------------------------------------------------------------- /campaigns/standalone-quests/self-hosted-evm/contracts/libraries/Account.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.16; 3 | 4 | struct Account { 5 | address self; 6 | bytes bytecode; 7 | uint256 balance; 8 | uint256 nonce; 9 | } 10 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/wtf-imps/contracts/Imp.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | abstract contract Imp { 5 | 6 | enum Target { Villager, Self } 7 | 8 | function attack() external virtual returns (Target); 9 | 10 | } -------------------------------------------------------------------------------- /campaigns/diamonds/stateful-libraries/test/hardhat/LibMap.test.js: -------------------------------------------------------------------------------- 1 | const { testLibMap } = require("./testsuites/testLibMap"); 2 | const input = require("../data/paths.json"); 3 | 4 | describe('LibMap (Part 1)', async function () { 5 | testLibMap("Public Test 1", input); 6 | }); -------------------------------------------------------------------------------- /campaigns/standalone-quests/self-hosted-evm/contracts/test/helpers/CreatedNoParams.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.16; 3 | 4 | contract CreatedNoParams { 5 | 6 | uint256 public value = 1; 7 | 8 | constructor() payable {} 9 | 10 | } -------------------------------------------------------------------------------- /campaigns/learning-assembly/calldata-manipulation/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomiclabs/hardhat-ethers"); 2 | require("@nomicfoundation/hardhat-chai-matchers"); 3 | 4 | /** @type import('hardhat/config').HardhatUserConfig */ 5 | module.exports = { 6 | solidity: "0.8.19", 7 | }; 8 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/clone-factories/test/hardhat/Elaine1.test.js: -------------------------------------------------------------------------------- 1 | const { testElaine } = require("./testsuites/testElaine"); 2 | const catData = require("../data/catData.json"); 3 | 4 | describe("Elaine (Part 1)", function () { 5 | testElaine("Public Test 1", catData); 6 | }); -------------------------------------------------------------------------------- /campaigns/understanding-storage/storage-efficiency/test/hardhat/Elegy1.test.js: -------------------------------------------------------------------------------- 1 | const { testElegy1 } = require("./testsuites/testElegy1"); 2 | const input = require("../data/verses.json"); 3 | 4 | describe("Elegy1 (Part 1)", function() { 5 | testElegy1("Public Test 1", input); 6 | }); -------------------------------------------------------------------------------- /campaigns/standalone-quests/unordered-key-set/test/hardhat/Crates1.test.js: -------------------------------------------------------------------------------- 1 | const { testCrates } = require("./testsuite/testCrates1"); 2 | const crateData = require("../data/crates.json"); 3 | 4 | describe("Crates (Part 1)", function() { 5 | testCrates("Public Test 1", crateData) 6 | }); -------------------------------------------------------------------------------- /campaigns/diamonds/building-diamonds/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomiclabs/hardhat-ethers"); 2 | require("@nomicfoundation/hardhat-chai-matchers"); 3 | 4 | /** 5 | * @type import('hardhat/config').HardhatUserConfig 6 | */ 7 | module.exports = { 8 | solidity: "0.8.19", 9 | }; 10 | -------------------------------------------------------------------------------- /campaigns/proxy-contracts/basic-proxies/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomicfoundation/hardhat-chai-matchers"); 2 | require("@nomiclabs/hardhat-ethers"); 3 | 4 | /** 5 | * @type import('hardhat/config').HardhatUserConfig 6 | */ 7 | module.exports = { 8 | solidity: "0.8.19", 9 | }; 10 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/clone-factories/contracts/SpiritCat.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; 5 | import "./TimeEscrow.sol"; 6 | 7 | contract SpiritCat is TimeEscrow { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/multicall/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomicfoundation/hardhat-chai-matchers"); 2 | require("@nomiclabs/hardhat-ethers"); 3 | 4 | /** 5 | * @type import('hardhat/config').HardhatUserConfig 6 | */ 7 | module.exports = { 8 | solidity: "0.8.19" 9 | }; 10 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/setting-up/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomicfoundation/hardhat-chai-matchers"); 2 | require("@nomiclabs/hardhat-ethers"); 3 | 4 | /** 5 | * @type import('hardhat/config').HardhatUserConfig 6 | */ 7 | module.exports = { 8 | solidity: "0.8.19", 9 | }; 10 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/unordered-key-set/test/hardhat/Crates2.test.js: -------------------------------------------------------------------------------- 1 | const { testCrates } = require("./testsuite/testCrates2"); 2 | const crateData = require("../data/crates.json"); 3 | 4 | 5 | describe("Crates (Part 2)", function() { 6 | testCrates("Public Test 1", crateData) 7 | }); -------------------------------------------------------------------------------- /campaigns/learning-assembly/yul-basics/test/hardhat/If.test.js: -------------------------------------------------------------------------------- 1 | const { testIf } = require("./testsuites/testIf"); 2 | const inputs = require("../data/if.json"); 3 | 4 | describe("If (Part 4)", function() { 5 | testIf("Public Test 1", inputs[0]); 6 | testIf("Public Test 2", inputs[1]); 7 | }); 8 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/clone-factories/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomicfoundation/hardhat-chai-matchers"); 2 | require("@nomiclabs/hardhat-ethers"); 3 | 4 | /** 5 | * @type import('hardhat/config').HardhatUserConfig 6 | */ 7 | module.exports = { 8 | solidity: "0.8.19", 9 | }; 10 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/merkle-proofs/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomicfoundation/hardhat-chai-matchers"); 2 | require("@nomiclabs/hardhat-ethers"); 3 | 4 | /** 5 | * @type import('hardhat/config').HardhatUserConfig 6 | */ 7 | module.exports = { 8 | solidity: "0.8.19", 9 | }; 10 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/state-channels/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomicfoundation/hardhat-chai-matchers"); 2 | require("@nomiclabs/hardhat-ethers"); 3 | 4 | /** 5 | * @type import('hardhat/config').HardhatUserConfig 6 | */ 7 | module.exports = { 8 | solidity: "0.8.20", 9 | }; 10 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/stealth-addresses/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomicfoundation/hardhat-chai-matchers"); 2 | require("@nomiclabs/hardhat-ethers"); 3 | 4 | /** 5 | * @type import('hardhat/config').HardhatUserConfig 6 | */ 7 | module.exports = { 8 | solidity: "0.8.19" 9 | }; 10 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/unexpected-ether/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomicfoundation/hardhat-chai-matchers"); 2 | require("@nomiclabs/hardhat-ethers"); 3 | 4 | /** 5 | * @type import('hardhat/config').HardhatUserConfig 6 | */ 7 | module.exports = { 8 | solidity: "0.8.19", 9 | }; 10 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/using-signatures/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomicfoundation/hardhat-chai-matchers"); 2 | require("@nomiclabs/hardhat-ethers"); 3 | 4 | /** 5 | * @type import('hardhat/config').HardhatUserConfig 6 | */ 7 | module.exports = { 8 | solidity: "0.8.19" 9 | }; 10 | -------------------------------------------------------------------------------- /campaigns/token-standards/building-erc-20/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomicfoundation/hardhat-chai-matchers"); 2 | require("@nomiclabs/hardhat-ethers"); 3 | 4 | /** 5 | * @type import('hardhat/config').HardhatUserConfig 6 | */ 7 | module.exports = { 8 | solidity: "0.8.20", 9 | }; 10 | -------------------------------------------------------------------------------- /campaigns/token-standards/building-erc-721/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomicfoundation/hardhat-chai-matchers"); 2 | require("@nomiclabs/hardhat-ethers"); 3 | 4 | /** 5 | * @type import('hardhat/config').HardhatUserConfig 6 | */ 7 | module.exports = { 8 | solidity: "0.8.20", 9 | }; 10 | -------------------------------------------------------------------------------- /campaigns/building-on-zksync/zksync-contracts/contracts/test/Ally.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | /// @notice A contract to be detected by `Senses`. 5 | contract Ally { 6 | 7 | uint256 public health = 100; 8 | uint256 public mana = 100; 9 | 10 | } -------------------------------------------------------------------------------- /campaigns/building-on-zksync/zksync-contracts/contracts/test/Enemy.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | /// @notice A contract to be detected by `Senses`. 5 | contract Enemy { 6 | 7 | uint256 public health = 100; 8 | uint256 public mana = 100; 9 | 10 | } -------------------------------------------------------------------------------- /campaigns/learning-assembly/yul-basics/test/hardhat/Arithmetic.test.js: -------------------------------------------------------------------------------- 1 | const { testArithmetic } = require("./testsuites/testArithmetic"); 2 | const inputs = require("../data/arithmetic.json"); 3 | 4 | describe("Arithmetic (Part 2)", function() { 5 | testArithmetic("Public Test 1", inputs[0]); 6 | }); 7 | -------------------------------------------------------------------------------- /campaigns/token-standards/building-erc-20/contracts/MintableDoubloon.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.20; 3 | 4 | import "./Doubloon.sol"; 5 | 6 | contract MintableDoubloon is Doubloon { 7 | 8 | constructor(uint256 _supply) Doubloon(_supply) {} 9 | 10 | } 11 | -------------------------------------------------------------------------------- /campaigns/learning-assembly/yul-basics/test/hardhat/Comparisons.test.js: -------------------------------------------------------------------------------- 1 | const { testComparisons } = require("./testsuites/testComparisons"); 2 | const input = require("../data/comparisons.json"); 3 | 4 | describe("Comparisons (Part 3)", function() { 5 | testComparisons("Public Test 1", input); 6 | }); 7 | -------------------------------------------------------------------------------- /campaigns/learning-assembly/yul-basics/test/hardhat/For.test.js: -------------------------------------------------------------------------------- 1 | const { testFor } = require("./testsuites/testFor"); 2 | const inputs = require("../data/for.json"); 3 | 4 | describe("For (Part 6)", function() { 5 | testFor("Public Test 1", inputs[0]); 6 | testFor("Public Test 2", inputs[1]); 7 | }); 8 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/delegate-call-detection/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomiclabs/hardhat-ethers"); 2 | require("@nomicfoundation/hardhat-chai-matchers"); 3 | 4 | /** 5 | * @type import('hardhat/config').HardhatUserConfig 6 | */ 7 | module.exports = { 8 | solidity: "0.8.19", 9 | }; 10 | -------------------------------------------------------------------------------- /campaigns/token-standards/building-erc-721/test/hardhat/AmuletPouch.test.js: -------------------------------------------------------------------------------- 1 | const { testAmuletPouch } = require("./testsuites/testAmuletPouch"); 2 | const input = require("../data/amuletPouch.json"); 3 | 4 | describe("Amulet Pouch (Part 4)", function() { 5 | testAmuletPouch("Public Test 1", input[0]); 6 | }); -------------------------------------------------------------------------------- /campaigns/learning-assembly/calldata-manipulation/test/hardhat/WhispersV1.test.js: -------------------------------------------------------------------------------- 1 | const { testWhispersV1 } = require("./testsuites/testWhispersV1"); 2 | const input = require("../data/whispersV1.json"); 3 | 4 | describe("WhispersV1 (Part 2)", function() { 5 | testWhispersV1("Public Test 1", input); 6 | }); 7 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/bypassing-extcodesize/contracts_/interfaces/IChallenger.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | interface IChallenger { 5 | 6 | /// @notice Called by Basilisk. Should return true. 7 | function challenge() external pure returns (bool); 8 | 9 | } -------------------------------------------------------------------------------- /campaigns/building-on-zksync/zksync-paymasters/contracts/LunarPaymaster.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "@matterlabs/zksync-contracts/l2/system-contracts/interfaces/IPaymaster.sol"; 5 | 6 | contract LunarPaymaster is IPaymaster { 7 | // TODO: Implement this paymaster! 8 | } -------------------------------------------------------------------------------- /campaigns/learning-assembly/bits-and-bytes/test/hardhat/Masks.test.js: -------------------------------------------------------------------------------- 1 | const { testMasks } = require("./testsuites/testMasks"); 2 | const inputs = require("../data/masks.json"); 3 | 4 | describe("Masks (Part 2)", function() { 5 | testMasks("Public Test 1", inputs[0]); 6 | testMasks("Public Test 2", inputs[1]); 7 | }); 8 | -------------------------------------------------------------------------------- /campaigns/token-standards/building-erc-20/test/data/doubloonTransfer.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "supply": 1000, 4 | "transferAmount1": 100, 5 | "transferAmount2": 50 6 | }, 7 | { 8 | "supply": 1000, 9 | "transferAmount1": 15, 10 | "transferAmount2": 6 11 | } 12 | ] -------------------------------------------------------------------------------- /campaigns/building-on-zksync/zksync-accounts/test/SummonerAccount.test.js: -------------------------------------------------------------------------------- 1 | const { testSummonerAccount } = require("./testsuites/TestSummonerAccount.js"); 2 | 3 | describe("Summoner Account (Part 2)", function() { 4 | const inputs = require("./data/inputs.json"); 5 | testSummonerAccount('Public Test 1', inputs[0]); 6 | }); -------------------------------------------------------------------------------- /campaigns/diamonds/building-diamonds/files-to-test.json: -------------------------------------------------------------------------------- 1 | [ 2 | "contracts/facets/DiamondCutFacet.sol", 3 | "contracts/facets/DiamondLoupeFacet.sol", 4 | "contracts/facets/OwnershipFacet.sol", 5 | "contracts/interfaces/IDiamondCut.sol", 6 | "contracts/libraries/LibDiamond.sol", 7 | "contracts/Diamond.sol" 8 | ] -------------------------------------------------------------------------------- /campaigns/learning-assembly/yul-basics/test/hardhat/Switch.test.js: -------------------------------------------------------------------------------- 1 | const { testSwitch } = require("./testsuites/testSwitch"); 2 | const inputs = require("../data/switch.json"); 3 | 4 | describe("Switch (Part 5)", function() { 5 | testSwitch("Public Test 1", inputs[0]); 6 | testSwitch("Public Test 2", inputs[1]); 7 | }); 8 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/hardhat-forking/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomicfoundation/hardhat-chai-matchers"); 2 | require("@nomiclabs/hardhat-ethers"); 3 | 4 | /** 5 | * @type import('hardhat/config').HardhatUserConfig 6 | */ 7 | module.exports = { 8 | solidity: { 9 | "version": "0.8.19" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/self-hosted-evm/contracts/test/helpers/CreatedParams.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.16; 3 | 4 | contract CreatedParams { 5 | 6 | uint256 public value; 7 | 8 | constructor(uint256 _value) payable { 9 | value = _value; 10 | } 11 | 12 | } -------------------------------------------------------------------------------- /campaigns/token-standards/building-erc-20/contracts/Doubloon.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.20; 3 | 4 | import "./interfaces/IERC20.sol"; 5 | 6 | /** 7 | * @dev ERC-20 token contract. 8 | */ 9 | contract Doubloon /* is IERC20 */ { 10 | 11 | constructor(uint256 _supply) { } 12 | 13 | } -------------------------------------------------------------------------------- /campaigns/token-standards/building-erc-721/test/hardhat/AmuletCreation.test.js: -------------------------------------------------------------------------------- 1 | const { testAmuletCreation } = require("./testsuites/testAmuletCreation"); 2 | const input = require("../data/amuletCreation.json"); 3 | 4 | describe("Amulet Creation (Part 2)", function() { 5 | testAmuletCreation("Public Test 1", input[0]); 6 | }); -------------------------------------------------------------------------------- /campaigns/understanding-storage/storage-efficiency/test/hardhat/Elegy2.test.js: -------------------------------------------------------------------------------- 1 | const { testElegy2 } = require("./testsuites/testElegy2"); 2 | const inputs = require("../data/songs.json"); 3 | 4 | describe("Elegy2 (Part 2)", function() { 5 | testElegy2("Public Test 1", inputs[0]); 6 | testElegy2("Public Test 2", inputs[1]); 7 | }); -------------------------------------------------------------------------------- /campaigns/standalone-quests/multicall/test/hardhat/Multicall.test.js: -------------------------------------------------------------------------------- 1 | const { testMulticall } = require("./testsuites/testMulticall.js"); 2 | const input = require("../data/multicall.json"); 3 | 4 | describe("Multicall (Part 2)", function() { 5 | input.callee = "GreaterArchives"; 6 | testMulticall("Public Test 1", input); 7 | }); 8 | -------------------------------------------------------------------------------- /campaigns/learning-assembly/yul-basics/test/hardhat/SafeMath.test.js: -------------------------------------------------------------------------------- 1 | const { testSafeMath } = require("./testsuites/testSafeMath"); 2 | const inputs = require("../data/safemath.json"); 3 | 4 | describe("SafeMath (Part 7)", function() { 5 | testSafeMath("Public Test 1", inputs[0]); 6 | testSafeMath("Public Test 2", inputs[1]); 7 | }); 8 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/merkle-proofs/test/hardhat/SacredTree2.test.js: -------------------------------------------------------------------------------- 1 | const { testTree } = require("./testsuites/testTree"); 2 | const proofTests = require("../data/proofs.json"); 3 | 4 | 5 | describe("Sacred Tree (Part 2)", function() { 6 | testTree("Public Test 1", proofTests[0]); 7 | testTree("Public Test 2", proofTests[1]); 8 | }); -------------------------------------------------------------------------------- /campaigns/standalone-quests/stealth-addresses/input/stealthTransfer.json: -------------------------------------------------------------------------------- 1 | { 2 | "stealthRecipient": "0xB9c8ec9cE5e018A7973d57AE1c74C6E697aC0D96", 3 | "publishedDataX": "0x7701a569affde4c369884dcc58852f733f5e0d35042295a151ac07e72588260d", 4 | "publishedDataY": "0xd793591c89ac13c8a85b29e2f4245870f673b0dc366169346865941b5f1a9465" 5 | } -------------------------------------------------------------------------------- /campaigns/proxy-contracts/openzeppelin-upgrades/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomicfoundation/hardhat-chai-matchers"); 2 | require("@nomiclabs/hardhat-ethers"); 3 | require('@openzeppelin/hardhat-upgrades'); 4 | 5 | /** 6 | * @type import('hardhat/config').HardhatUserConfig 7 | */ 8 | module.exports = { 9 | solidity: "0.8.19" 10 | }; 11 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/multicall/test/hardhat/GreatScribe.test.js: -------------------------------------------------------------------------------- 1 | const { testGreatScribe } = require("./testsuites/testGreatScribe.js"); 2 | const input = require("../data/greatScribe.json"); 3 | 4 | describe("GreatScribe (Part 1)", function() { 5 | input.callee = "GreatArchives"; 6 | testGreatScribe("Public Test 1", input); 7 | }); 8 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/self-hosted-evm/test/foundry/Create-Create2.7.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./testsuites/TestCreate.sol"; 5 | import "./testsuites/TestCreate2.sol"; 6 | 7 | contract CreatePublicTest1 is TestCreate {} 8 | 9 | contract Create2PublicTest1 is TestCreate2 {} 10 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/state-channels/contracts/PaymentChannel.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./interfaces/IPaymentChannel.sol"; 5 | 6 | contract PaymentChannel /* is IPaymentChannel */ { 7 | 8 | constructor(address payable _worker, uint256 _time) payable { } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/state-channels/test/hardhat/MineCart.test.js: -------------------------------------------------------------------------------- 1 | const { testMineCart } = require("./testsuites/testMineCart"); 2 | const inputs = require("../data/mineCart.json"); 3 | 4 | describe("Mine Cart (Part 2)", function() { 5 | testMineCart("Public Test 1", inputs[0]); 6 | testMineCart("Public Test 2", inputs[1]); 7 | }); 8 | -------------------------------------------------------------------------------- /campaigns/learning-assembly/bits-and-bytes/test/hardhat/Scrambled.test.js: -------------------------------------------------------------------------------- 1 | const { testScrambled } = require("./testsuites/testScrambled"); 2 | const inputs = require("../data/scrambled.json"); 3 | 4 | describe("Scrambled (Part 4)", function() { 5 | testScrambled("Public Test 1", inputs[0]); 6 | testScrambled("Public Test 2", inputs[1]); 7 | }); 8 | -------------------------------------------------------------------------------- /campaigns/learning-assembly/memory-manipulation/test/hardhat/FreeMemoryPointer.test.js: -------------------------------------------------------------------------------- 1 | const { testFreeMemoryPointer } = require("./testsuites/testFreeMemoryPointer"); 2 | const input = require("../data/freeMemoryPointer.json"); 3 | 4 | describe("Free Memory Pointer (Part 2)", function() { 5 | testFreeMemoryPointer("Public Test 1", input); 6 | }); 7 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/hardhat-forking/contracts/QuarryBase.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | contract QuarryBase { 5 | 6 | // OTHER FUNCTIONS AND STATE VARIABLE OMITTED 7 | 8 | function _dig() internal view returns (string memory treasure) { 9 | // LOGIC OMITTED 10 | } 11 | 12 | } -------------------------------------------------------------------------------- /campaigns/standalone-quests/self-hosted-evm/test/foundry/Call-StaticCall.5.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./testsuites/TestCall.sol"; 5 | import "./testsuites/TestStaticCall.sol"; 6 | 7 | contract CallPublicTest1 is TestCall {} 8 | 9 | contract StaticCallPublicTest1 is TestStaticCall {} 10 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/unexpected-ether/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts' 3 | out = 'artifacts' 4 | libs = ['lib', '../../../lib', '../../../node_modules'] 5 | solc_version = '0.8.19' 6 | remappings = [ 7 | "test/=test/" 8 | ] 9 | 10 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/diamonds/stateful-libraries/test/foundry/LibMap.1.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./testsuites/TestLibMap.sol"; 5 | 6 | contract PublicTest1 is TestLibMap { 7 | 8 | string TEST_DATA_PATH = "test/data/paths.json"; 9 | constructor() TestLibMap(TEST_DATA_PATH) { } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/clone-factories/test/foundry/Elaine.1.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./testsuites/TestElaine.sol"; 5 | 6 | contract PublicTest1 is TestElaine { 7 | 8 | string TEST_DATA_PATH = "test/data/catData.json"; 9 | constructor() TestElaine(TEST_DATA_PATH) { } 10 | 11 | } -------------------------------------------------------------------------------- /campaigns/building-on-zksync/zksync-paymasters/test/LunarPaymaster.test.js: -------------------------------------------------------------------------------- 1 | const { testPaymaster } = require("./testsuites/TestPaymaster.js"); 2 | 3 | describe("Lunar Paymaster (Part 2)", function() { 4 | const inputs = require("./data/inputs.json"); 5 | testPaymaster('Public Test 1', inputs[0]); 6 | testPaymaster('Public Test 2', inputs[1]); 7 | }); -------------------------------------------------------------------------------- /campaigns/learning-assembly/calldata-manipulation/test/foundry/WhispersV1.2.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./testsuites/TestWhispersV1.sol"; 5 | 6 | contract PublicTest1 is TestWhispersV1 { 7 | 8 | string PATH = "test/data/whispersV1.json"; 9 | constructor() TestWhispersV1(PATH) { } 10 | 11 | } -------------------------------------------------------------------------------- /campaigns/standalone-quests/unordered-key-set/test/foundry/Crates.2.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./testsuites/TestCrates2.sol"; 5 | 6 | contract PublicTest1 is TestCrates2 { 7 | 8 | string TEST_DATA_PATH = "test/data/crates.json"; 9 | constructor() TestCrates2(TEST_DATA_PATH) { } 10 | } 11 | -------------------------------------------------------------------------------- /campaigns/learning-assembly/memory-manipulation/test/data/freeMemoryPointer.json: -------------------------------------------------------------------------------- 1 | { 2 | "freeMemoryPointer": [ "0x80", "0x0120" ], 3 | "maxAccessedMemory": [ "0x80", "0x100" ], 4 | "allocateMemory": [ "0x20", "0x100"], 5 | "freeMemory": [ 6 | { "allocated": "0x20", "size": "0x20" }, 7 | { "allocated": "0x20", "size": "0x21" } 8 | ] 9 | } -------------------------------------------------------------------------------- /campaigns/playing-with-op-stack/create-op-rollup/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "create-op-rollup", 3 | "version": "1.0.0", 4 | "scripts": { 5 | "test": "hardhat compile && forge test", 6 | "deploy": "hardhat run ../../../scripts/deploy-validator.js --network sepolia" 7 | }, 8 | "author": "", 9 | "license": "MIT" 10 | } 11 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/unordered-key-set/test/foundry/Crates.1.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./testsuites/TestCrates1.sol"; 5 | 6 | contract PublicTest1 is TestCrates1 { 7 | 8 | string TEST_DATA_PATH = "test/data/crates.json"; 9 | constructor() TestCrates1(TEST_DATA_PATH) { } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /campaigns/learning-assembly/bits-and-bytes/test/hardhat/BitOperators.test.js: -------------------------------------------------------------------------------- 1 | const { testBitOperators } = require("./testsuites/testBitOperators"); 2 | const inputs = require("../data/bitOperators.json"); 3 | 4 | describe("Bit Operators (Part 1)", function() { 5 | testBitOperators("Public Test 1", inputs[0]); 6 | testBitOperators("Public Test 2", inputs[1]); 7 | }); 8 | -------------------------------------------------------------------------------- /campaigns/learning-assembly/memory-manipulation/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomiclabs/hardhat-ethers"); 2 | require("@nomicfoundation/hardhat-chai-matchers"); 3 | 4 | /** @type import('hardhat/config').HardhatUserConfig */ 5 | module.exports = { 6 | solidity: "0.8.19", 7 | settings: { 8 | optimizer: { 9 | enabled: false 10 | } 11 | } 12 | }; 13 | -------------------------------------------------------------------------------- /campaigns/learning-assembly/yul-basics/test/foundry/Comparisons.3.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./testsuites/TestComparisons.sol"; 5 | 6 | contract PublicTest1 is TestComparisons { 7 | string TEST_DATA_PATH = "test/data/comparisons.json"; 8 | constructor() TestComparisons(TEST_DATA_PATH) { } 9 | } 10 | -------------------------------------------------------------------------------- /campaigns/building-on-zksync/zksync-accounts/contracts/SummonerAccount.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "@matterlabs/zksync-contracts/l2/system-contracts/interfaces/IAccount.sol"; 5 | 6 | contract SummonerAccount is IAccount { 7 | // TODO: Implement this account! 8 | constructor(address _summoner, address _creature) { } 9 | } -------------------------------------------------------------------------------- /campaigns/learning-assembly/memory-manipulation/test/hardhat/DynamicArray.test.js: -------------------------------------------------------------------------------- 1 | const { testDynamicArray } = require("./testsuites/testDynamicArray"); 2 | const inputs = require("../data/dynamicArray.json"); 3 | 4 | describe("Dynamic Array (Part 4)", function() { 5 | testDynamicArray("Public Test 1", inputs[0]); 6 | testDynamicArray("Public Test 2", inputs[1]); 7 | }); 8 | -------------------------------------------------------------------------------- /campaigns/learning-assembly/memory-manipulation/test/hardhat/MemoryLayout.test.js: -------------------------------------------------------------------------------- 1 | const { testMemoryLayout } = require("./testsuites/testMemoryLayout"); 2 | const inputs = require("../data/memoryLayout.json"); 3 | 4 | describe("Memory Layout (Part 3)", function() { 5 | testMemoryLayout("Public Test 1", inputs[0]); 6 | testMemoryLayout("Public Test 2", inputs[1]); 7 | }); 8 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/self-hosted-evm/test/foundry/DelegateCall-CallCode.6.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./testsuites/TestDelegateCall.sol"; 5 | import "./testsuites/TestCallCode.sol"; 6 | 7 | contract DelegateCallPublicTest1 is TestDelegateCall {} 8 | 9 | contract CallCodePublicTest1 is TestCallCode {} 10 | -------------------------------------------------------------------------------- /campaigns/understanding-storage/storage-efficiency/test/foundry/Elegy.1.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./testsuites/TestElegy1.sol"; 5 | 6 | contract PublicTest1 is TestElegy1 { 7 | 8 | string TEST_DATA_PATH = "./test/data/verses.json"; 9 | 10 | constructor() TestElegy1(TEST_DATA_PATH) { } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /campaigns/learning-assembly/yul-basics/test/foundry/Arithmetic.2.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./testsuites/TestArithmetic.sol"; 5 | 6 | contract PublicTest1 is TestArithmetic { 7 | string PATH = "test/data/arithmetic.json"; 8 | string KEY = "[0]"; 9 | constructor() TestArithmetic(PATH, KEY) { } 10 | } 11 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/elliptic-curve/test/hardhat/FieldElement.test.js: -------------------------------------------------------------------------------- 1 | const { testFeltArithmetic } = require("./testsuites/testFieldElement.js"); 2 | const inputs = require("../data/feltOperations.json"); 3 | 4 | describe("Field Element (Part 1)", function() { 5 | testFeltArithmetic("Public Test 1", inputs[0]); 6 | testFeltArithmetic("Public Test 2", inputs[1]); 7 | }); -------------------------------------------------------------------------------- /campaigns/standalone-quests/state-channels/test/data/mineCart.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "ores": [0, 4, 8, 12, 15, 18, 21], 4 | "loads": [4, 4, 4, 4, 3, 3], 5 | "timePerMove": 1000000000 6 | }, 7 | { 8 | "ores": [0, 1, 3, 7, 11, 15, 19, 21], 9 | "loads": [2, 3, 4, 4, 4, 4, 4], 10 | "timePerMove": 2000000000 11 | } 12 | ] -------------------------------------------------------------------------------- /campaigns/token-standards/building-erc-20/test/hardhat/DoubloonEvents.test.js: -------------------------------------------------------------------------------- 1 | const { testDoubloonEvents } = require("./testsuites/testDoubloonEvents"); 2 | const input = require("../data/doubloonTransfer.json"); 3 | 4 | describe("Doubloon Events (Part 4)", function() { 5 | testDoubloonEvents("Public Test 1", input[0]); 6 | testDoubloonEvents("Public Test 2", input[1]); 7 | }); -------------------------------------------------------------------------------- /campaigns/building-on-zksync/zksync-paymasters/contracts/test/Box.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | contract Box { 5 | 6 | uint256 public value; 7 | 8 | constructor(uint256 _value) { 9 | value = _value; 10 | } 11 | 12 | function set(uint256 _value) public { 13 | value = _value; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/elliptic-curve/test/hardhat/EllipticCurve.test.js: -------------------------------------------------------------------------------- 1 | const { testCurveOperations } = require("./testsuites/testEllipticCurve.js"); 2 | const inputs = require("../data/curveOperations.json"); 3 | 4 | describe("EllipticCurve (Part 2)", function() { 5 | testCurveOperations("Public Test 1", inputs[0]); 6 | testCurveOperations("Public Test 2", inputs[1]); 7 | }); -------------------------------------------------------------------------------- /campaigns/learning-assembly/memory-manipulation/test/foundry/FreeMemoryPointer.2.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./testsuites/TestFreeMemoryPointer.sol"; 5 | 6 | contract PublicTest1 is TestFreeMemoryPointer { 7 | string PATH = "test/data/freeMemoryPointer.json"; 8 | constructor() TestFreeMemoryPointer(PATH) { } 9 | } 10 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/self-hosted-evm/test/hardhat/Instructions.test.js: -------------------------------------------------------------------------------- 1 | const { testInstructions } = require("./testsuites/TestInstructions.js"); 2 | const inputs = require("../data/instructions.json"); 3 | 4 | describe("Instructions (Part 4)", function () { 5 | for (let i = 0; i < inputs.length; i++) { 6 | testInstructions(`Public Test ${i + 1}`, inputs[i]); 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /campaigns/token-standards/building-erc-20/test/hardhat/DoubloonCreation.test.js: -------------------------------------------------------------------------------- 1 | const { testDoubloonCreation } = require("./testsuites/testDoubloonCreation"); 2 | const input = require("../data/doubloonCreation.json"); 3 | 4 | describe("Doubloon Creation (Part 2)", function() { 5 | testDoubloonCreation("Public Test 1", input[0]); 6 | testDoubloonCreation("Public Test 2", input[1]); 7 | }); -------------------------------------------------------------------------------- /campaigns/token-standards/building-erc-20/test/hardhat/DoubloonTransfer.test.js: -------------------------------------------------------------------------------- 1 | const { testDoubloonTransfer } = require("./testsuites/testDoubloonTransfer"); 2 | const input = require("../data/doubloonTransfer.json"); 3 | 4 | describe("Doubloon Transfer (Part 3)", function() { 5 | testDoubloonTransfer("Public Test 1", input[0]); 6 | testDoubloonTransfer("Public Test 2", input[1]); 7 | }); -------------------------------------------------------------------------------- /campaigns/token-standards/building-erc-20/test/hardhat/MintableDoubloon.test.js: -------------------------------------------------------------------------------- 1 | const { testMintableDoubloon } = require("./testsuites/testMintableDoubloon"); 2 | const input = require("../data/mintableDoubloon.json"); 3 | 4 | describe("Mintable Doubloon (Part 5)", function() { 5 | testMintableDoubloon("Public Test 1", input[0]); 6 | testMintableDoubloon("Public Test 2", input[1]); 7 | }); -------------------------------------------------------------------------------- /campaigns/understanding-storage/storage-efficiency/test/data/verses.json: -------------------------------------------------------------------------------- 1 | { 2 | "firstVerse": "0x0001020304050607", 3 | "secondVerse": "0x101112131415161718191a1b1c1d1e1f101112131415161718191a1b1c1d1e1f", 4 | "thirdVerse": "0x202122232425262728292A2b2c2d2e2f20212223", 5 | "fourthVerse": "0x303132333435363738393a3b3c3d3e3f", 6 | "fifthVerse": "0x404142434445464748494a4b" 7 | } -------------------------------------------------------------------------------- /campaigns/gas-golfing-s1/changing-base/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomicfoundation/hardhat-toolbox"); 2 | 3 | /** 4 | * @type import('hardhat/config').HardhatUserConfig 5 | */ 6 | module.exports = { 7 | solidity: { 8 | version: "0.8.19", 9 | settings: { 10 | optimizer: { 11 | enabled: true, 12 | runs: 800, 13 | }, 14 | }, 15 | }, 16 | }; 17 | -------------------------------------------------------------------------------- /campaigns/gas-golfing-s1/roman-numerals/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomicfoundation/hardhat-toolbox"); 2 | 3 | /** 4 | * @type import('hardhat/config').HardhatUserConfig 5 | */ 6 | module.exports = { 7 | solidity: { 8 | version: "0.8.19", 9 | settings: { 10 | optimizer: { 11 | enabled: true, 12 | runs: 800, 13 | }, 14 | }, 15 | }, 16 | }; 17 | -------------------------------------------------------------------------------- /campaigns/gas-golfing-s1/remove-duplicates/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomicfoundation/hardhat-toolbox"); 2 | 3 | /** 4 | * @type import('hardhat/config').HardhatUserConfig 5 | */ 6 | module.exports = { 7 | solidity: { 8 | version: "0.8.19", 9 | settings: { 10 | optimizer: { 11 | enabled: true, 12 | runs: 800, 13 | }, 14 | }, 15 | }, 16 | }; 17 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/setting-up/contracts/HelloGuardian.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | contract HelloGuardian { 5 | 6 | /// @return "Hello Guardian" 7 | function hello() external pure returns (string memory) { 8 | // UNCOMMENT THE NEXT LINE TO MAKE THE TEST PASS 9 | // return "Hello Guardian"; 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/state-channels/contracts/MineCart.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./interfaces/IMineCart.sol"; 5 | 6 | contract MineCart /* is IMineCart */ { 7 | 8 | constructor( 9 | address payable _worker1, 10 | address payable _worker2, 11 | uint256 _timePerMove 12 | ) payable { } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/stealth-addresses/test/hardhat/CursedGrimoires.test.js: -------------------------------------------------------------------------------- 1 | const { testCursedGrimoires } = require("./testsuites/testCursedGrimoires"); 2 | const inputs = require("../data/cursedGrimoires.json"); 3 | 4 | describe("Cursed Grimoires (Part 2)", function() { 5 | 6 | testCursedGrimoires("Public Test 1", inputs[0]); 7 | testCursedGrimoires("Public Test 2", inputs[1]); 8 | 9 | }); -------------------------------------------------------------------------------- /campaigns/token-standards/building-erc-721/contracts/AmuletPouch.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.20; 3 | 4 | import "./interfaces/IERC721.sol"; 5 | import "./interfaces/IAmuletPouch.sol"; 6 | 7 | /** 8 | * @dev ERC-721 Token Receiver token contract. 9 | */ 10 | contract AmuletPouch /* is IAmuletPouch */ { 11 | 12 | constructor(address _amulet) { } 13 | 14 | } -------------------------------------------------------------------------------- /campaigns/token-standards/building-erc-721/test/foundry/AmuletPouch.4.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.20; 3 | 4 | import "./testsuites/TestAmuletPouch.sol"; 5 | 6 | contract PublicTest1 is TestAmuletPouch { 7 | string DATA_PATH = "test/data/amuletPouch.json"; 8 | string DATA_KEY = "[0]"; 9 | constructor() TestAmuletPouch(DATA_PATH, DATA_KEY) { } 10 | } -------------------------------------------------------------------------------- /campaigns/gas-golfing-s1/internal-representation/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomicfoundation/hardhat-toolbox"); 2 | 3 | /** 4 | * @type import('hardhat/config').HardhatUserConfig 5 | */ 6 | module.exports = { 7 | solidity: { 8 | version: "0.8.19", 9 | settings: { 10 | optimizer: { 11 | enabled: true, 12 | runs: 800, 13 | }, 14 | }, 15 | }, 16 | }; 17 | -------------------------------------------------------------------------------- /campaigns/diamonds/stateful-libraries/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomiclabs/hardhat-ethers"); 2 | require("@nomicfoundation/hardhat-chai-matchers"); 3 | 4 | // You need to export an object to set up your config 5 | // Go to https://hardhat.org/config/ to learn more 6 | 7 | /** 8 | * @type import('hardhat/config').HardhatUserConfig 9 | */ 10 | module.exports = { 11 | solidity: '0.8.19' 12 | } 13 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/multicall/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts' 3 | out = 'artifacts' 4 | libs = ['lib', '../../../lib', '../../..'] 5 | solc_version = '0.8.19' 6 | fs_permissions = [ 7 | { access = 'read', path = './test/data' }, 8 | ] 9 | remappings = [ 10 | "test/=test/" 11 | ] 12 | 13 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/standalone-quests/wtf-imps/contracts/TrickyImp.sol: -------------------------------------------------------------------------------- 1 | ///// 2 | // RULE: No modifying this file! 3 | ///// 4 | 5 | // SPDX-License-Identifier: MIT 6 | pragma solidity ^0.8.19; 7 | 8 | import { Imp } from "./Imp.sol"; 9 | 10 | contract TrickyImp is Imp { 11 | 12 | function attack() external pure override returns (Target) { 13 | return Target.Villager; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /campaigns/token-standards/building-erc-721/test/foundry/AmuletCreation.2.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.20; 3 | 4 | import "./testsuites/TestAmuletCreation.sol"; 5 | 6 | contract PublicTest1 is TestAmuletCreation { 7 | string DATA_PATH = "test/data/amuletCreation.json"; 8 | string DATA_KEY = "[0]"; 9 | constructor() TestAmuletCreation(DATA_PATH, DATA_KEY) { } 10 | } -------------------------------------------------------------------------------- /campaigns/understanding-storage/storage-efficiency/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts' 3 | out = 'artifacts' 4 | libs = ['lib', '../../../lib', '../../../node_modules'] 5 | solc_version = '0.8.19' 6 | fs_permissions = [{ access = 'read', path = './test/data' }] 7 | remappings = [ 8 | "test/=test/" 9 | ] 10 | 11 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/diamonds/stateful-libraries/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts' 3 | out = 'artifacts' 4 | libs = ['lib', '../../../lib', '../../../node_modules'] 5 | solc_version = '0.8.19' 6 | fs_permissions = [ 7 | { access = 'read', path = './test/data' } 8 | ] 9 | remappings = [ 10 | "test/=test/" 11 | ] 12 | 13 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/learning-assembly/calldata-manipulation/contracts/WhispersV2.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | contract WhispersV2 { 5 | 6 | /// @notice Converts a compressed uint256 array into standard uint256[]. 7 | function compressedWhisper() public pure returns (uint256[] memory array) { 8 | assembly { 9 | 10 | } 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /campaigns/proxy-contracts/basic-proxies/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts' 3 | out = 'artifacts' 4 | libs = ['lib', '../../../lib', '../../../node_modules'] 5 | solc_version = '0.8.19' 6 | fs_permissions = [ 7 | { access = 'read', path = './test/data' } 8 | ] 9 | remappings = [ 10 | "test/=test/" 11 | ] 12 | 13 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/standalone-quests/clone-factories/contracts/test/Token.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; 5 | 6 | contract Token is ERC20 { 7 | 8 | uint constant _initial_supply = 100 ether; 9 | 10 | constructor(address owner) ERC20("Test Token", "TKN") { 11 | _mint(owner, _initial_supply); 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /campaigns/learning-assembly/bits-and-bytes/contracts/Scrambled.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | contract Scrambled { 5 | 6 | /// @notice Recover an address that has been scrambled... 7 | function recoverAddress(bytes32 value) 8 | public 9 | pure 10 | returns (address rvalue) 11 | { 12 | assembly { 13 | 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /campaigns/learning-assembly/bits-and-bytes/test/hardhat/MaskGenerator.test.js: -------------------------------------------------------------------------------- 1 | const { testMaskGenerator } = require("./testsuites/testMaskGenerator"); 2 | const inputs = require("../data/maskGenerator.json"); 3 | 4 | describe("Mask Generator (Part 3)", function() { 5 | testMaskGenerator("Public Test 1", inputs[0]); 6 | testMaskGenerator("Public Test 2", inputs[1]); 7 | testMaskGenerator("Public Test 3", inputs[2]); 8 | }); 9 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/celestia-blobstream/contracts_/interfaces/IObservatory.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import { SharesProof } from "../types/BlobstreamTypes.sol"; 5 | 6 | interface IObservatory { 7 | 8 | function isProven() external view returns (bool); 9 | 10 | function proveComet( 11 | SharesProof calldata _proof 12 | ) external view; 13 | 14 | } -------------------------------------------------------------------------------- /campaigns/standalone-quests/merkle-proofs/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts' 3 | out = 'artifacts' 4 | libs = ['lib', '../../../lib', '../../../node_modules'] 5 | solc_version = '0.8.19' 6 | fs_permissions = [ 7 | { access = 'read', path = './test/data' } 8 | ] 9 | remappings = [ 10 | "test/=test/" 11 | ] 12 | 13 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/token-standards/building-erc-20/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts' 3 | out = 'artifacts' 4 | libs = ['lib', '../../../lib', '../../../node_modules'] 5 | solc_version = '0.8.20' 6 | fs_permissions = [ 7 | { access = 'read', path = './test/data' } 8 | ] 9 | remappings = [ 10 | 'test/=test/' 11 | ] 12 | 13 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/token-standards/building-erc-721/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts' 3 | out = 'artifacts' 4 | libs = ['lib', '../../../lib', '../../../node_modules'] 5 | solc_version = '0.8.20' 6 | fs_permissions = [ 7 | { access = 'read', path = './test/data' } 8 | ] 9 | remappings = [ 10 | 'test/=test/' 11 | ] 12 | 13 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/gas-optimization/solidity-optimization/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts' 3 | out = 'artifacts' 4 | libs = ['lib', '../../../lib'] 5 | solc_version = '0.8.19' 6 | optimizer_runs = 800 7 | fs_permissions = [ 8 | { access = 'read', path = './test/data' } 9 | ] 10 | remappings = [ 11 | "test/=test/" 12 | ] 13 | 14 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/standalone-quests/quadratic-public-goods/contracts/VillageFunding.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./interfaces/IVillageFunding.sol"; 5 | 6 | contract VillageFunding /* is IVillageFunding */ { 7 | 8 | constructor( 9 | address[] memory _villagers, 10 | address[] memory _projects 11 | ) payable { 12 | // ... 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/wtf-imps/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomiclabs/hardhat-ethers"); 2 | require("@nomicfoundation/hardhat-chai-matchers"); 3 | 4 | require("dotenv").config({ path: "../../../.env" }); 5 | 6 | /** 7 | * @type import('hardhat/config').HardhatUserConfig 8 | */ 9 | module.exports = { 10 | solidity: "0.8.19", 11 | defaultNetwork: "hardhat", 12 | networks: { 13 | hardhat: {} 14 | } 15 | }; 16 | -------------------------------------------------------------------------------- /campaigns/diamonds/building-diamonds/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts' 3 | out = 'artifacts' 4 | libs = ['lib', '../../../lib', 'node_modules', '../../../node_modules'] 5 | solc_version = '0.8.19' 6 | fs_permissions = [ 7 | { access = 'read', path = './test/data' } 8 | ] 9 | remappings = [ 10 | "test/=test/" 11 | ] 12 | 13 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/learning-assembly/yul-basics/test/data/arithmetic.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "addition": { "x": 2, "y": 1 }, 4 | "multiplication": { "x": 1, "y": -1 }, 5 | "signedDivision": { "x": -16, "y": 2 }, 6 | "modulo": { 7 | "x": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 8 | "y": 3 9 | }, 10 | "power": { "x": 1, "y": 0 } 11 | } 12 | ] -------------------------------------------------------------------------------- /campaigns/standalone-quests/delegate-call-detection/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts' 3 | out = 'artifacts' 4 | libs = ['lib', '../../../lib', '../../../node_modules'] 5 | solc_version = '0.8.19' 6 | fs_permissions = [ 7 | { access = 'read', path = './test/data' } 8 | ] 9 | remappings = [ 10 | "test/=test/" 11 | ] 12 | 13 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/standalone-quests/state-channels/test/hardhat/PaymentChannel.test.js: -------------------------------------------------------------------------------- 1 | const { testPaymentChannel } = require("./testsuites/testPaymentChannel"); 2 | const inputs = require("../data/paymentChannel.json"); 3 | 4 | describe("Payment Channel (Part 1)", function() { 5 | testPaymentChannel("Public Test 1", inputs[0]); 6 | testPaymentChannel("Public Test 2", inputs[1]); 7 | testPaymentChannel("Public Test 3", inputs[2]); 8 | }); 9 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/stealth-addresses/contracts/CursedGrimoires.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; 5 | import "./interfaces/IGrimoires.sol"; 6 | 7 | contract CursedGrimoires is IGrimoires, ERC721 { 8 | 9 | constructor() ERC721("Cursed Grimoires", "GRIM") { } 10 | 11 | // Implement IGrimores interface... 12 | 13 | } 14 | -------------------------------------------------------------------------------- /campaigns/gas-optimization/solidity-optimization/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomiclabs/hardhat-ethers"); 2 | require("@nomicfoundation/hardhat-chai-matchers"); 3 | 4 | /** 5 | * @type import('hardhat/config').HardhatUserConfig 6 | */ 7 | module.exports = { 8 | solidity: { 9 | version: "0.8.19", 10 | settings: { 11 | optimizer: { 12 | enabled: true, 13 | runs: 800, 14 | } 15 | } 16 | } 17 | }; -------------------------------------------------------------------------------- /campaigns/standalone-quests/clone-factories/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts' 3 | out = 'artifacts' 4 | libs = ['lib', '../../../lib', 'node_modules', '../../../node_modules'] 5 | solc_version = '0.8.19' 6 | fs_permissions = [ 7 | { access = 'read', path = './test/data' } 8 | ] 9 | remappings = [ 10 | "test/=test/" 11 | ] 12 | 13 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/standalone-quests/elliptic-curve/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomicfoundation/hardhat-chai-matchers"); 2 | require("@nomiclabs/hardhat-ethers"); 3 | 4 | /** 5 | * @type import('hardhat/config').HardhatUserConfig 6 | */ 7 | module.exports = { 8 | solidity: { 9 | "version": "0.8.19", 10 | settings: { 11 | optimizer: { 12 | enabled: true, 13 | runs: 200 14 | } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /campaigns/token-standards/building-erc-721/contracts/Amulet.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.20; 3 | 4 | import "./interfaces/IERC165.sol"; 5 | import "./interfaces/IERC721.sol"; 6 | import "./interfaces/IERC721Metadata.sol"; 7 | import "./interfaces/IERC721TokenReceiver.sol"; 8 | 9 | /** 10 | * @dev ERC-721 token contract. 11 | */ 12 | contract Amulet /* is IERC721, IERC721Metadata */ { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /campaigns/token-standards/building-erc-721/test/data/amuletPouch.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "numMembers": 5, 4 | "withdrawRequests": [ 5 | { 6 | "requesterId": 1, 7 | "withdrawalId": 2 8 | }, 9 | { 10 | "requesterId": 1, 11 | "withdrawalId": 3 12 | } 13 | ], 14 | "approvedRequestId": 0 15 | } 16 | ] -------------------------------------------------------------------------------- /campaigns/gas-optimization/assembly-optimization/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomiclabs/hardhat-ethers"); 2 | require("@nomicfoundation/hardhat-chai-matchers"); 3 | 4 | /** 5 | * @type import('hardhat/config').HardhatUserConfig 6 | */ 7 | module.exports = { 8 | solidity: { 9 | version: "0.8.19", 10 | settings: { 11 | optimizer: { 12 | enabled: true, 13 | runs: 800, 14 | } 15 | } 16 | } 17 | }; 18 | -------------------------------------------------------------------------------- /campaigns/learning-assembly/calldata-manipulation/test/data/whispersV1.json: -------------------------------------------------------------------------------- 1 | { 2 | "uintValues": [ 3 | 128, 4 | 256, 5 | "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" 6 | ], 7 | "strValues": [ 8 | "test string", 9 | "UTF-8 𝄞 test string", 10 | "A very very very very very very very very very very very very very very very very very long test string" 11 | ] 12 | } -------------------------------------------------------------------------------- /campaigns/standalone-quests/hardhat-forking/test/foundry/EmeraldQuarry.2.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./testsuites/TestForTreasure.sol"; 5 | 6 | contract PublicTest1 is TestForTreasure { 7 | 8 | bytes32 constant EXPECTED_HASH 9 | = 0xf10ae9bec86eee2391ad0cfed71a6ab8bd63c437cfe4a1a65cc27dc482c8640f; 10 | 11 | constructor() TestForTreasure(1, EXPECTED_HASH) { } 12 | 13 | } -------------------------------------------------------------------------------- /campaigns/standalone-quests/quadratic-public-goods/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomicfoundation/hardhat-chai-matchers"); 2 | require("@nomiclabs/hardhat-ethers"); 3 | 4 | /** 5 | * @type import('hardhat/config').HardhatUserConfig 6 | */ 7 | module.exports = { 8 | solidity: { 9 | version: "0.8.20", 10 | settings: { 11 | optimizer: { 12 | enabled: true, 13 | runs: 200 14 | } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/unordered-key-set/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts' 3 | out = 'artifacts' 4 | libs = ['lib', '../../../lib', 'node_modules', '../../../node_modules'] 5 | solc_version = '0.8.19' 6 | fs_permissions = [ 7 | { access = 'read', path = './test/data' } 8 | ] 9 | remappings = [ 10 | "test/=test/" 11 | ] 12 | 13 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/understanding-storage/storage-efficiency/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomicfoundation/hardhat-chai-matchers"); 2 | require("@nomiclabs/hardhat-ethers"); 3 | 4 | /** 5 | * @type import('hardhat/config').HardhatUserConfig 6 | */ 7 | module.exports = { 8 | solidity: { 9 | version: "0.8.19", 10 | settings: { 11 | optimizer: { 12 | enabled: true, 13 | runs: 200 14 | } 15 | } 16 | }, 17 | }; 18 | -------------------------------------------------------------------------------- /campaigns/building-on-zksync/zksync-accounts/contracts/test/Box.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | /// @notice Test contract for `SummonerAccount` to interact with. 5 | contract Box { 6 | 7 | uint256 public value; 8 | 9 | constructor(uint256 _value) { 10 | value = _value; 11 | } 12 | 13 | function set(uint256 _value) public { 14 | value = _value; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /campaigns/gas-golfing-s1/roman-numerals/contracts/Challenge.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | contract Challenge { 5 | 6 | /** 7 | * @dev Converts an integer to roman numerals 8 | * @param n Integer to convert to roman numerals (0 <= _n <= 3999) 9 | * @return String of roman numerals 10 | */ 11 | function romanify(uint256 n) external pure returns (string memory) { } 12 | 13 | } -------------------------------------------------------------------------------- /campaigns/learning-assembly/bits-and-bytes/test/data/scrambled.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "scrambled": "0x00F5C1A19135E60000000000000000E0a1358485Dc00008b649939bce3F0B300", 4 | "unscrambled": "0x8b649939bce3F0B3E0a1358485DcF5C1A19135E6" 5 | }, 6 | { 7 | "scrambled": "0x0069AB65Ef0a380000000000000000440B143994500000Ab4fE3085C01187400", 8 | "unscrambled": "0xAb4fE3085C011874440B1439945069AB65Ef0a38" 9 | } 10 | ] -------------------------------------------------------------------------------- /campaigns/standalone-quests/hardhat-forking/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts' 3 | out = 'artifacts' 4 | libs = ['lib', '../../../lib', 'node_modules', '../../../node_modules'] 5 | solc_version = '0.8.19' 6 | fs_permissions = [ 7 | { access = 'read', path = './output/treasure.json' } 8 | ] 9 | remappings = [ 10 | "test/=test/" 11 | ] 12 | 13 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/standalone-quests/hardhat-forking/test/foundry/RockQuarry.1.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./testsuites/TestForTreasure.sol"; 5 | 6 | contract PublicTest1 is TestForTreasure { 7 | 8 | bytes32 constant EXPECTED_HASH 9 | = 0x18d7f451b112d9d66d372b57a0f006069ccc3e6f27848af53713260f77ed03c2; 10 | 11 | constructor() TestForTreasure(0, EXPECTED_HASH) { } 12 | 13 | } -------------------------------------------------------------------------------- /campaigns/standalone-quests/hardhat-forking/test/foundry/RubyQuarry.3.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./testsuites/TestForTreasure.sol"; 5 | 6 | contract PublicTest1 is TestForTreasure { 7 | 8 | bytes32 constant EXPECTED_HASH 9 | = 0x37624ea007df73dcf742c012ecd6b45423a79e118153e712c2b51ed33779dcff; 10 | 11 | constructor() TestForTreasure(2, EXPECTED_HASH) { } 12 | 13 | } -------------------------------------------------------------------------------- /campaigns/standalone-quests/low-level-calls/contracts_/Farm2.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | contract Farm2 { 5 | 6 | uint256 public seedCount; 7 | 8 | function driveTractor( 9 | address _tractor, 10 | bytes calldata _instructions 11 | ) external { 12 | (bool result, ) = _tractor.delegatecall(_instructions); 13 | require(result, "Call failed"); 14 | } 15 | 16 | } -------------------------------------------------------------------------------- /campaigns/standalone-quests/self-hosted-evm/test/hardhat/Create-Create2.test.js: -------------------------------------------------------------------------------- 1 | const { testCreate } = require("./testsuites/TestCreate.js"); 2 | const { testCreate2 } = require("./testsuites/TestCreate2.js"); 3 | 4 | describe("Create (Part 7)", function () { 5 | describe("Create", function () { 6 | testCreate("Public Test 1"); 7 | }); 8 | 9 | describe("Create2", function () { 10 | testCreate2("Public Test 1"); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/state-channels/test/data/paymentChannel.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "paymentAmount": 111500, 4 | "time": 1000, 5 | "totalFunds": 111500 6 | }, 7 | { 8 | "paymentAmount": 231000000, 9 | "time": 100000, 10 | "totalFunds": 232000000 11 | }, 12 | { 13 | "paymentAmount": 18800000000, 14 | "time": 100000, 15 | "totalFunds": 28800000000 16 | } 17 | ] -------------------------------------------------------------------------------- /campaigns/learning-assembly/yul-basics/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts' 3 | out = 'artifacts' 4 | libs = ['lib', '../../../lib', '../../..'] 5 | solc_version = '0.8.19' 6 | fs_permissions = [ 7 | { access = 'read', path = './test/data' }, 8 | { access = 'read', path = './artifacts' } 9 | ] 10 | remappings = [ 11 | "test/=test/" 12 | ] 13 | 14 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/standalone-quests/quadratic-public-goods/test/hardhat/VillageVoting.test.js: -------------------------------------------------------------------------------- 1 | const { testVillageVoting } = require("./testsuites/TestVillageVoting.js"); 2 | 3 | describe("Village Voting (Part 1)", function() { 4 | const inputs1 = require("../../test/data/VillageVoting1.json"); 5 | testVillageVoting("Public Test 1", inputs1); 6 | 7 | const inputs2 = require("../../test/data/VillageVoting2.json"); 8 | testVillageVoting("Public Test 2", inputs2); 9 | }); -------------------------------------------------------------------------------- /campaigns/learning-assembly/bits-and-bytes/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts' 3 | out = 'artifacts' 4 | libs = ['lib', '../../../lib', '../../..'] 5 | solc_version = '0.8.19' 6 | fs_permissions = [ 7 | { access = 'read', path = './test/data' }, 8 | { access = 'read', path = './artifacts' } 9 | ] 10 | remappings = [ 11 | "test/=test/" 12 | ] 13 | 14 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/randomness/breaking-rng/contracts_/Shadeling.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | contract Shadeling { 5 | bool public isPredicted; 6 | 7 | function predict(bytes32 x) external { 8 | require(x == _random()); 9 | isPredicted = true; 10 | } 11 | 12 | function _random() internal view returns (bytes32) { 13 | return keccak256(abi.encode(block.timestamp)); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/quadratic-public-goods/contracts/VillageVoting.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./interfaces/IVillageVoting.sol"; 5 | 6 | contract VillageVoting /* is IVillageVoting */ { 7 | 8 | constructor( 9 | address[] memory _villagers, 10 | uint256[] memory _tokenBalances, 11 | uint256[] memory _proposalIds 12 | ) { 13 | // ... 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /campaigns/learning-assembly/calldata-manipulation/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts' 3 | out = 'artifacts' 4 | libs = ['lib', '../../../lib', '../../..'] 5 | solc_version = '0.8.19' 6 | fs_permissions = [ 7 | { access = 'read', path = './test/data' }, 8 | { access = 'read', path = './artifacts' } 9 | ] 10 | remappings = [ 11 | "test/=test/" 12 | ] 13 | 14 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/standalone-quests/celestia-blobstream/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts_' 3 | out = 'artifacts' 4 | script = 'script' 5 | libs = [ 6 | 'lib', 7 | '../../../lib', 8 | 'node_modules', 9 | '../../../node_modules' 10 | ] 11 | solc_version = '0.8.19' 12 | 13 | [rpc_endpoints] 14 | sepolia = 'https://rpc-sepolia-eth.nodeguardians.io' 15 | 16 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/standalone-quests/quadratic-public-goods/test/hardhat/VillageFunding.test.js: -------------------------------------------------------------------------------- 1 | const { testVillageFunding } = require("./testsuites/TestVillageFunding.js"); 2 | 3 | describe("Village Funding (Part 2)", function() { 4 | const inputs1 = require("../../test/data/VillageFunding1.json"); 5 | testVillageFunding("Public Test 1", inputs1); 6 | 7 | const inputs2 = require("../../test/data/VillageFunding2.json"); 8 | testVillageFunding("Public Test 2", inputs2); 9 | }); -------------------------------------------------------------------------------- /campaigns/standalone-quests/self-hosted-evm/test/hardhat/Call-StaticCall.test.js: -------------------------------------------------------------------------------- 1 | const { testCall } = require("./testsuites/TestCall.js"); 2 | const { testStaticCall } = require("./testsuites/TestStaticCall.js"); 3 | 4 | describe("Call & Staticcall (Part 5)", function () { 5 | describe("Call", function () { 6 | testCall("Public Test 1"); 7 | }); 8 | 9 | describe("Staticcall", function () { 10 | testStaticCall("Public Test 1"); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/wtf-imps/test/foundry/TrickyImp.1.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "forge-std/Test.sol"; 5 | import "../../contracts/TrickyImp.sol"; 6 | 7 | contract PublicTest1 is Test { 8 | 9 | function test_attack_itself() external { 10 | TrickyImp trickyImp = new TrickyImp(); 11 | require(trickyImp.attack() == Imp.Target.Self, "Should attack itself"); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/vanity-theft/contracts_/Loot.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | contract Loot { 5 | 6 | // The thief owns the loot... 7 | address public owner = 0x7D0673F244c9C2e890fd294E1c65a51Fc7359963; 8 | 9 | // Take back the loot! 10 | function transfer(address _newOwner) public { 11 | require(msg.sender == owner, "Hands off my loot!"); 12 | owner = _newOwner; 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /campaigns/standalone-quests/wtf-imps/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "wtf-imps", 3 | "version": "1.0.1", 4 | "scripts": { 5 | "test": "hardhat test --network hardhat && forge test", 6 | "test:hardhat": "hardhat test --network hardhat" 7 | }, 8 | "author": "", 9 | "license": "MIT", 10 | "dependencies": { 11 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", 12 | "@nomiclabs/hardhat-ethers": "^2.2.2", 13 | "hardhat": "^2.13.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/celestia-blobstream/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "celestia-blobstream", 3 | "version": "1.0.0", 4 | "scripts": { 5 | "test": "hardhat compile && forge build" 6 | }, 7 | "author": "", 8 | "license": "MIT", 9 | "dependencies": { 10 | "@node-guardians/ng-quests-helpers": "^1.0.0", 11 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", 12 | "@nomiclabs/hardhat-ethers": "^2.2.2", 13 | "hardhat": "^2.13.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/elliptic-curve/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts' 3 | out = 'artifacts' 4 | libs = ['lib', '../../../lib', 'node_modules', '../../../node_modules'] 5 | solc_version = '0.8.19' 6 | fs_permissions = [ 7 | { access = 'read', path = './test/data' } 8 | ] 9 | remappings = [ 10 | 'test/=test/' 11 | ] 12 | no_match_path = "contracts/test/*.sol" 13 | 14 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/standalone-quests/quadratic-public-goods/contracts/test/ReentrancyAttacker.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "../interfaces/IVillageFunding.sol"; 5 | 6 | contract ReentrancyAttacker { 7 | 8 | bool hasReentered; 9 | 10 | fallback() external payable { 11 | if (hasReentered) { return; } 12 | 13 | hasReentered = true; 14 | IVillageFunding(msg.sender).withdraw(); 15 | 16 | } 17 | 18 | } -------------------------------------------------------------------------------- /campaigns/standalone-quests/delegate-call-detection/contracts/Mind.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | contract Mind { 5 | /// @notice This could be useful... 6 | constructor() {} 7 | 8 | /// @notice Checks if the current call is a delegate call. 9 | /// @return isDelegate true if this is a delegate call, false otherwise. 10 | function isDelegateCall() public view returns (bool isDelegate) { 11 | 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/elliptic-curve/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "elliptic-curve", 3 | "version": "1.0.2", 4 | "scripts": { 5 | "test": "hardhat test --network hardhat && forge test", 6 | "test:hardhat": "hardhat test --network hardhat" 7 | }, 8 | "author": "", 9 | "license": "MIT", 10 | "dependencies": { 11 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", 12 | "@nomiclabs/hardhat-ethers": "^2.2.2", 13 | "hardhat": "^2.13.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/quadratic-public-goods/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts' 3 | out = 'artifacts' 4 | libs = ['lib', '../../../lib', 'node_modules', '../../../node_modules'] 5 | solc_version = '0.8.20' 6 | fs_permissions = [ 7 | { access = 'read', path = './test/data' } 8 | ] 9 | remappings = [ 10 | 'test/=test/' 11 | ] 12 | no_match_path = "contracts/test/*.sol" 13 | 14 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/standalone-quests/stealth-addresses/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts' 3 | out = 'artifacts' 4 | libs = ['lib', '../../../lib', 'node_modules', '../../../node_modules'] 5 | solc_version = '0.8.19' 6 | fs_permissions = [ 7 | { access = 'read', path = './test/data' }, 8 | { access = 'read', path = './output' } 9 | ] 10 | remappings = [ 11 | "test/=test/" 12 | ] 13 | 14 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/standalone-quests/wtf-imps/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts' 3 | out = 'artifacts' 4 | libs = ['lib', '../../../lib', '../../../node_modules'] 5 | solc_version = '0.8.19' 6 | fs_permissions = [ 7 | { access = 'read', path = './test/data' } 8 | ] 9 | remappings = [ 10 | 'test/=test/' 11 | ] 12 | no_match_path = "contracts/test/*.sol" 13 | evm_version = "shanghai" 14 | 15 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/token-standards/building-erc-20/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "creating-erc-20-tokens", 3 | "version": "1.0.1", 4 | "scripts": { 5 | "test": "hardhat test --network hardhat && forge test", 6 | "test:hardhat": "hardhat test --network hardhat" 7 | }, 8 | "author": "", 9 | "license": "MIT", 10 | "dependencies": { 11 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", 12 | "@nomiclabs/hardhat-ethers": "^2.2.2", 13 | "hardhat": "^2.13.0" 14 | } 15 | } -------------------------------------------------------------------------------- /campaigns/building-on-zksync/zksync-paymasters/test/data/inputs.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "nightTime": "05:30:00", 4 | "dayTime": "06:30:00", 5 | "smallGasLimit": "0.003", 6 | "mediumGasLimit": "0.005", 7 | "largeGasLimit": "0.009" 8 | }, 9 | { 10 | "nightTime": "18:30:00", 11 | "dayTime": "17:30:00", 12 | "smallGasLimit": "0.0018", 13 | "mediumGasLimit": "0.006", 14 | "largeGasLimit": "0.008" 15 | } 16 | ] -------------------------------------------------------------------------------- /campaigns/gas-golfing-s1/remove-duplicates/contracts/Challenge.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | contract Challenge { 5 | 6 | /** 7 | * @dev Remove duplicates from an array of uint8 8 | * @param input An array of uint8 9 | * @return output An array of uint8 without duplicates 10 | */ 11 | function dispelDuplicates( 12 | uint8[] calldata input 13 | ) public pure returns (uint8[] memory output) { } 14 | 15 | } -------------------------------------------------------------------------------- /campaigns/standalone-quests/unexpected-ether/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "unexpected-ether", 3 | "version": "2.0.0", 4 | "scripts": { 5 | "test": "hardhat test --network hardhat && forge test", 6 | "test:hardhat": "hardhat test --network hardhat" 7 | }, 8 | "author": "", 9 | "license": "MIT", 10 | "dependencies": { 11 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", 12 | "@nomiclabs/hardhat-ethers": "^2.2.2", 13 | "hardhat": "^2.13.0" 14 | } 15 | } -------------------------------------------------------------------------------- /campaigns/standalone-quests/using-signatures/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts' 3 | out = 'artifacts' 4 | libs = ['lib', '../../../lib', 'node_modules', '../../../node_modules'] 5 | solc_version = '0.8.19' 6 | fs_permissions = [ 7 | { access = 'read', path = './output' }, 8 | { access = 'read', path = './test/data' } 9 | ] 10 | remappings = [ 11 | "test/=test/" 12 | ] 13 | 14 | 15 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/token-standards/building-erc-721/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "creating-erc-721-tokens", 3 | "version": "1.0.1", 4 | "scripts": { 5 | "test": "hardhat test --network hardhat && forge test", 6 | "test:hardhat": "hardhat test --network hardhat" 7 | }, 8 | "author": "", 9 | "license": "MIT", 10 | "dependencies": { 11 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", 12 | "@nomiclabs/hardhat-ethers": "^2.2.2", 13 | "hardhat": "^2.13.0" 14 | } 15 | } -------------------------------------------------------------------------------- /campaigns/token-standards/building-erc-721/test/hardhat/AmuletTransfer.test.js: -------------------------------------------------------------------------------- 1 | const { 2 | testAmuletTransfer, 3 | testAmuletSafeTransfer, 4 | testAmuletEvents 5 | } = require("./testsuites/testAmuletTransfer"); 6 | const input = require("../data/amuletTransfer.json"); 7 | 8 | describe("Amulet Transfer (Part 3)", function() { 9 | testAmuletTransfer("Public Test 1", input[0]); 10 | testAmuletSafeTransfer("Public Test 2", input[0]); 11 | testAmuletEvents("Public Test 3"); 12 | }); -------------------------------------------------------------------------------- /campaigns/get-rekt/cream-rekt/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts_' 3 | out = 'artifacts' 4 | script = 'script' 5 | libs = [ 6 | 'lib', 7 | '../../../lib', 8 | 'node_modules', 9 | '../../../node_modules' 10 | ] 11 | solc_version = '0.8.19' 12 | remappings = [ 13 | 'test/=test/' 14 | ] 15 | 16 | [rpc_endpoints] 17 | sepolia = 'https://rpc-sepolia-eth.nodeguardians.io' 18 | 19 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/get-rekt/poly-rekt/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts_' 3 | out = 'artifacts' 4 | script = 'script' 5 | libs = [ 6 | 'lib', 7 | '../../../lib', 8 | 'node_modules', 9 | '../../../node_modules' 10 | ] 11 | solc_version = '0.8.19' 12 | remappings = [ 13 | 'test/=test/' 14 | ] 15 | 16 | [rpc_endpoints] 17 | sepolia = 'https://rpc-sepolia-eth.nodeguardians.io' 18 | 19 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/standalone-quests/hardhat-forking/contracts/EmeraldQuarry.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./QuarryBase.sol"; 5 | 6 | contract EmeraldQuarry is QuarryBase { 7 | 8 | uint256 constant UNLOCKED_TIME = 4817832457; 9 | 10 | function dig() external view returns (string memory treasure) { 11 | 12 | require(block.timestamp > UNLOCKED_TIME, "Quarry not unlocked yet"); 13 | 14 | return super._dig(); 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /campaigns/diamonds/using-diamonds/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts_' 3 | out = 'artifacts' 4 | script = 'script' 5 | libs = [ 6 | 'lib', 7 | 'node_modules', 8 | '../../../lib', 9 | '../../../node_modules' 10 | ] 11 | solc_version = '0.8.19' 12 | remappings = [ 13 | 'test/=test/' 14 | ] 15 | 16 | [rpc_endpoints] 17 | sepolia = 'https://rpc-sepolia-eth.nodeguardians.io' 18 | 19 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/get-rekt/wintermute-rekt/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts_' 3 | out = 'artifacts' 4 | script = 'script' 5 | libs = [ 6 | 'lib', 7 | '../../../lib', 8 | 'node_modules', 9 | '../../../node_modules' 10 | ] 11 | solc_version = '0.8.19' 12 | remappings = [ 13 | 'test/=test/' 14 | ] 15 | 16 | [rpc_endpoints] 17 | sepolia = 'https://rpc-sepolia-eth.nodeguardians.io' 18 | 19 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/learning-assembly/yul-basics/test/foundry/If.4.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./testsuites/TestIf.sol"; 5 | 6 | contract PublicTest1 is TestIf { 7 | string PATH = "test/data/if.json"; 8 | string KEY = "[0]"; 9 | constructor() TestIf(PATH, KEY) { } 10 | } 11 | 12 | contract PublicTest2 is TestIf { 13 | string PATH = "test/data/if.json"; 14 | string KEY = "[1]"; 15 | constructor() TestIf(PATH, KEY) { } 16 | } 17 | -------------------------------------------------------------------------------- /campaigns/randomness/breaking-rng/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts_' 3 | out = 'artifacts' 4 | script = 'script' 5 | libs = [ 6 | 'lib', 7 | '../../../lib', 8 | 'node_modules', 9 | '../../../node_modules' 10 | ] 11 | solc_version = '0.8.19' 12 | remappings = [ 13 | 'test/=test/' 14 | ] 15 | 16 | [rpc_endpoints] 17 | sepolia = 'https://rpc-sepolia-eth.nodeguardians.io' 18 | 19 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/standalone-quests/delegate-call-detection/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "delegate-call-detection", 3 | "version": "2.0.0", 4 | "scripts": { 5 | "test": "hardhat test --network hardhat && forge test", 6 | "test:hardhat": "hardhat test --network hardhat" 7 | }, 8 | "author": "", 9 | "license": "MIT", 10 | "dependencies": { 11 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", 12 | "@nomiclabs/hardhat-ethers": "^2.2.2", 13 | "hardhat": "^2.13.0" 14 | } 15 | } -------------------------------------------------------------------------------- /campaigns/standalone-quests/self-hosted-evm/test/hardhat/DelegateCall-CallCode.test.js: -------------------------------------------------------------------------------- 1 | const { testCallCode } = require("./testsuites/TestCallCode.js"); 2 | const { testDelegateCall } = require("./testsuites/TestDelegateCall.js"); 3 | 4 | describe("DelegateCall & CallCode (Part 6)", function () { 5 | describe("DelegateCall", function () { 6 | testDelegateCall("Public Test 1"); 7 | }); 8 | 9 | describe("CallCode", function () { 10 | testCallCode("Public Test 1"); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/state-channels/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts' 3 | out = 'artifacts' 4 | libs = ['lib', '../../../lib', '../../../node_modules'] 5 | solc_version = '0.8.20' 6 | fs_permissions = [ 7 | { access = 'read', path = './test/data' } 8 | ] 9 | remappings = [ 10 | 'test/=test/', 11 | '@openzeppelin/contracts=../../../node_modules/@openzeppelin/contracts/' 12 | ] 13 | 14 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/standalone-quests/unordered-key-set/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "unordered-key-set", 3 | "version": "2.0.0", 4 | "scripts": { 5 | "test": "hardhat test --network hardhat && forge test", 6 | "test:hardhat": "hardhat test --network hardhat" 7 | }, 8 | "author": "", 9 | "license": "MIT", 10 | "dependencies": { 11 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", 12 | "@nomiclabs/hardhat-ethers": "^2.2.2", 13 | "hardhat": "^2.13.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /campaigns/building-on-zksync/zksync-contracts/contracts/Senses.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | // TODO: Fix this contract 5 | /* 6 | contract Senses { 7 | 8 | bytes enemyCode; 9 | 10 | constructor(address _firstEnemy) { 11 | enemyCode = _firstEnemy.code; 12 | } 13 | 14 | function detect(address _target) external view returns (bool) { 15 | return (keccak256(_target.code) == keccak256(enemyCode)); 16 | } 17 | 18 | } 19 | */ -------------------------------------------------------------------------------- /campaigns/gas-optimization/assembly-optimization/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts' 3 | out = 'artifacts' 4 | libs = ['lib', '../../../lib', '../../../node_modules'] 5 | solc_version = '0.8.19' 6 | optimizer_runs = 800 7 | fs_permissions = [ 8 | { access = 'read', path = './test/data' } 9 | ] 10 | remappings = [ 11 | "test/=test/" 12 | ] 13 | no_match_path = "contracts/test/TestProbe.sol" 14 | 15 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/learning-assembly/yul-basics/test/foundry/For.6.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./testsuites/TestFor.sol"; 5 | 6 | contract PublicTest1 is TestFor { 7 | string PATH = "test/data/for.json"; 8 | string KEY = "[0]"; 9 | constructor() TestFor(PATH, KEY) { } 10 | } 11 | 12 | contract PublicTest2 is TestFor { 13 | string PATH = "test/data/for.json"; 14 | string KEY = "[1]"; 15 | constructor() TestFor(PATH, KEY) { } 16 | } 17 | -------------------------------------------------------------------------------- /campaigns/randomness/chainlink-vrf/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts_' 3 | out = 'artifacts' 4 | script = 'script' 5 | libs = [ 6 | 'lib', 7 | '../../../lib', 8 | 'node_modules/', 9 | '../../../node_modules/' 10 | ] 11 | solc_version = '0.8.19' 12 | remappings = [ 13 | 'test/=test/' 14 | ] 15 | 16 | [rpc_endpoints] 17 | sepolia = 'https://rpc-sepolia-eth.nodeguardians.io' 18 | 19 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/standalone-quests/multicall/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "multicall", 3 | "version": "2.0.0", 4 | "scripts": { 5 | "test": "hardhat test --network hardhat && forge test", 6 | "test:hardhat": "hardhat test --network hardhat" 7 | }, 8 | "author": "", 9 | "license": "MIT", 10 | "dependencies": { 11 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", 12 | "@nomiclabs/hardhat-ethers": "^2.2.2", 13 | "hardhat": "^2.13.0" 14 | } 15 | } -------------------------------------------------------------------------------- /campaigns/standalone-quests/unexpected-ether/contracts/Attacker.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./SimpleGameV1.sol"; 5 | 6 | contract Attacker { 7 | 8 | /** 9 | * @notice Wins a Silverfish game by claiming the pool money successfully 10 | * @param game address of simple game to win 11 | * @dev You can assume SimpleGameV1 already has 0.5 ETH in the pool 12 | */ 13 | function attack(SimpleGameV1 game) public payable {} 14 | } 15 | -------------------------------------------------------------------------------- /campaigns/understanding-storage/storage-efficiency/test/foundry/Elegy.2.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./testsuites/TestElegy2.sol"; 5 | 6 | string constant TEST_DATA_PATH = "./test/data/songs.json"; 7 | 8 | contract PublicTest1 is TestElegy2 { 9 | 10 | constructor() TestElegy2(TEST_DATA_PATH, "[0]") { } 11 | 12 | } 13 | 14 | contract PublicTest2 is TestElegy2 { 15 | 16 | constructor() TestElegy2(TEST_DATA_PATH, "[1]") { } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /campaigns/learning-assembly/calldata-manipulation/test/hardhat/WhispersV2.test.js: -------------------------------------------------------------------------------- 1 | const { cheating } = require("@node-guardians/ng-quests-helpers"); 2 | const { testWhispersV2 } = require("./testsuites/testWhispersV2"); 3 | const inputs = require("../data/whispersV2.json"); 4 | 5 | describe("WhispersV2 (Part 3)", function () { 6 | testWhispersV2("Public Test 1", inputs[0]); 7 | testWhispersV2("Public Test 2", inputs[1]); 8 | testWhispersV2("Public Test 3", {compressed: "0x", uncompressed: []}); 9 | }); 10 | -------------------------------------------------------------------------------- /campaigns/proxy-contracts/basic-proxies/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "basic-proxies", 3 | "version": "2.0.0", 4 | "scripts": { 5 | "test": "hardhat test --network hardhat && forge test", 6 | "test:hardhat": "hardhat test --network hardhat" 7 | }, 8 | "author": "", 9 | "license": "MIT", 10 | "dependencies": { 11 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", 12 | "@nomiclabs/hardhat-ethers": "^2.2.2", 13 | "hardhat": "^2.13.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /campaigns/proxy-contracts/proxy-security/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts_' 3 | out = 'artifacts' 4 | script = 'script' 5 | libs = [ 6 | 'lib', 7 | '../../../lib', 8 | 'node_modules', 9 | '../../../node_modules/' 10 | ] 11 | solc_version = '0.8.19' 12 | remappings = [ 13 | 'test/=test/' 14 | ] 15 | 16 | [rpc_endpoints] 17 | sepolia = 'https://rpc-sepolia-eth.nodeguardians.io' 18 | 19 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/standalone-quests/low-level-calls/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts_' 3 | out = 'artifacts' 4 | script = 'script' 5 | libs = [ 6 | 'lib', 7 | '../../../lib', 8 | 'node_modules', 9 | '../../../node_modules' 10 | ] 11 | solc_version = '0.8.19' 12 | remappings = [ 13 | 'test/=test/' 14 | ] 15 | 16 | [rpc_endpoints] 17 | sepolia = 'https://rpc-sepolia-eth.nodeguardians.io' 18 | 19 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/standalone-quests/setting-up/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "setting-up", 3 | "version": "1.0.0", 4 | "scripts": { 5 | "test": "hardhat test --network hardhat && forge test", 6 | "test:hardhat": "hardhat test --network hardhat" 7 | }, 8 | "author": "", 9 | "license": "MIT", 10 | "dependencies": { 11 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", 12 | "@nomiclabs/hardhat-ethers": "^2.2.2", 13 | "hardhat": "^2.13.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /campaigns/diamonds/stateful-libraries/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "stateful-libraries", 3 | "version": "2.0.0", 4 | "scripts": { 5 | "test": "hardhat test --network hardhat && forge test", 6 | "test:hardhat": "hardhat test --network hardhat" 7 | }, 8 | "author": "", 9 | "license": "MIT", 10 | "dependencies": { 11 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", 12 | "@nomiclabs/hardhat-ethers": "^2.2.2", 13 | "hardhat": "^2.13.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/bypassing-extcodesize/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts_' 3 | out = 'artifacts' 4 | script = 'script' 5 | libs = [ 6 | 'lib', 7 | '../../../lib', 8 | 'node_modules', 9 | '../../../node_modules' 10 | ] 11 | solc_version = '0.8.19' 12 | remappings = [ 13 | 'test/=test/' 14 | ] 15 | 16 | [rpc_endpoints] 17 | sepolia = 'https://rpc-sepolia-eth.nodeguardians.io' 18 | 19 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/standalone-quests/hardhat-forking/contracts/RockQuarry.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./QuarryBase.sol"; 5 | 6 | contract RockQuarry is QuarryBase { 7 | 8 | address public constant owner = 0xD23d39ffF7E391e62D464cd5eF09e52ed58bc889; 9 | 10 | function dig() external view returns (string memory treasure) { 11 | 12 | require(msg.sender == owner, "Caller must be owner"); 13 | 14 | return super._dig(); 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /campaigns/standalone-quests/price-oracle-attack/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts_' 3 | out = 'artifacts' 4 | script = 'script' 5 | libs = [ 6 | 'lib', 7 | '../../../lib', 8 | 'node_modules', 9 | '../../../node_modules' 10 | ] 11 | solc_version = '0.8.19' 12 | remappings = [ 13 | 'test/=test/' 14 | ] 15 | 16 | [rpc_endpoints] 17 | sepolia = 'https://rpc-sepolia-eth.nodeguardians.io' 18 | 19 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/standalone-quests/using-signatures/test/hardhat/Grandmasters.test.js: -------------------------------------------------------------------------------- 1 | const { 2 | testGrandmasters, 3 | testInitialGrandmaster 4 | } = require("./testsuites/testGrandmasters"); 5 | const sigData = require("../data/signatures.json"); 6 | 7 | describe("Grandmasters (Part 2)", function() { 8 | 9 | describe("Public Test 1", function () { 10 | testInitialGrandmaster(); 11 | }); 12 | 13 | describe("Public Test 2", function () { 14 | testGrandmasters(sigData); 15 | }); 16 | 17 | }); 18 | -------------------------------------------------------------------------------- /campaigns/understanding-storage/storage-layout/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts_' 3 | out = 'artifacts' 4 | script = 'script' 5 | libs = [ 6 | 'lib', 7 | '../../../lib', 8 | 'node_modules', 9 | '../../../node_modules' 10 | ] 11 | solc_version = '0.8.19' 12 | remappings = [ 13 | 'test/=test/' 14 | ] 15 | 16 | [rpc_endpoints] 17 | sepolia = 'https://rpc-sepolia-eth.nodeguardians.io' 18 | 19 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/standalone-quests/unordered-key-set/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomicfoundation/hardhat-chai-matchers"); 2 | require("@nomiclabs/hardhat-ethers"); 3 | 4 | /** 5 | * @type import('hardhat/config').HardhatUserConfig 6 | */ 7 | module.exports = { 8 | solidity: { 9 | version: "0.8.19", 10 | settings: { 11 | optimizer: { 12 | enabled: true, 13 | runs: 200 14 | } 15 | } 16 | }, 17 | paths: { 18 | sources: "./contracts", 19 | tests: "./test", 20 | }, 21 | }; 22 | -------------------------------------------------------------------------------- /campaigns/gas-optimization/assembly-optimization/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "assembly-optimization", 3 | "version": "2.0.0", 4 | "scripts": { 5 | "test": "hardhat test --network hardhat && forge test", 6 | "test:hardhat": "hardhat test --network hardhat" 7 | }, 8 | "author": "", 9 | "license": "MIT", 10 | "dependencies": { 11 | "cli-table": "0.3.11", 12 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", 13 | "@nomiclabs/hardhat-ethers": "^2.2.2", 14 | "hardhat": "^2.13.0" 15 | } 16 | } -------------------------------------------------------------------------------- /campaigns/gas-optimization/solidity-optimization/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "solidity-optimization", 3 | "version": "2.0.0", 4 | "scripts": { 5 | "test": "hardhat test --network hardhat && forge test", 6 | "test:hardhat": "hardhat test --network hardhat" 7 | }, 8 | "author": "", 9 | "license": "MIT", 10 | "dependencies": { 11 | "cli-table": "0.3.11", 12 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", 13 | "@nomiclabs/hardhat-ethers": "^2.2.2", 14 | "hardhat": "^2.13.0" 15 | } 16 | } -------------------------------------------------------------------------------- /campaigns/learning-assembly/bits-and-bytes/test/foundry/Masks.2.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./testsuites/TestMasks.sol"; 5 | 6 | contract PublicTest1 is TestMasks { 7 | string PATH = "test/data/masks.json"; 8 | string KEY = "[0]"; 9 | constructor() TestMasks(PATH, KEY) { } 10 | } 11 | 12 | contract PublicTest2 is TestMasks { 13 | string PATH = "test/data/masks.json"; 14 | string KEY = "[1]"; 15 | constructor() TestMasks(PATH, KEY) { } 16 | } 17 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/setting-up/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts_' 3 | out = 'artifacts' 4 | script = 'script' 5 | libs = [ 6 | 'lib', 7 | '../../../lib', 8 | '../../../node_modules' 9 | ] 10 | solc_version = '0.8.19' 11 | remappings = [ 12 | 'test/=test/' 13 | ] 14 | no_match_path = "contracts_/utils/*.sol" 15 | 16 | [rpc_endpoints] 17 | sepolia = 'https://rpc-sepolia-eth.nodeguardians.io' 18 | 19 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/learning-assembly/yul-basics/test/foundry/Switch.5.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./testsuites/TestSwitch.sol"; 5 | 6 | contract PublicTest1 is TestSwitch { 7 | string PATH = "test/data/switch.json"; 8 | string KEY = "[0]"; 9 | constructor() TestSwitch(PATH, KEY) { } 10 | } 11 | 12 | contract PublicTest2 is TestSwitch { 13 | string PATH = "test/data/switch.json"; 14 | string KEY = "[1]"; 15 | constructor() TestSwitch(PATH, KEY) { } 16 | } 17 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/quadratic-public-goods/test/foundry/VillageVoting.1.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./testsuites/TestVillageVoting.sol"; 5 | 6 | contract PublicTest1 is TestVillageVoting { 7 | string PATH = "test/data/VillageVoting1.json"; 8 | constructor() TestVillageVoting(PATH) {} 9 | } 10 | 11 | contract PublicTest2 is TestVillageVoting { 12 | string PATH = "test/data/VillageVoting2.json"; 13 | constructor() TestVillageVoting(PATH) {} 14 | } 15 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/quadratic-public-goods/test/foundry/VillageFunding.2.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./testsuites/TestVillageFunding.sol"; 5 | 6 | contract PublicTest1 is TestVillageFunding { 7 | string PATH = "test/data/VillageFunding1.json"; 8 | constructor() TestVillageFunding(PATH) {} 9 | } 10 | 11 | contract PublicTest2 is TestVillageFunding { 12 | string PATH = "test/data/VillageFunding2.json"; 13 | constructor() TestVillageFunding(PATH) {} 14 | } 15 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/self-hosted-evm/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "self-hosted-evm", 3 | "version": "1.0.0", 4 | "scripts": { 5 | "test": "hardhat test --network hardhat && forge test", 6 | "test:hardhat": "hardhat test --network hardhat" 7 | }, 8 | "author": "", 9 | "license": "MIT", 10 | "dependencies": { 11 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", 12 | "@nomiclabs/hardhat-ethers": "^2.2.2", 13 | "hardhat-ignore-warnings": "^0.2.8", 14 | "hardhat": "^2.13.0" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/state-channels/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "state-channels", 3 | "version": "1.0.0", 4 | "scripts": { 5 | "test": "hardhat test --network hardhat && forge test", 6 | "test:hardhat": "hardhat test --network hardhat" 7 | }, 8 | "author": "", 9 | "license": "MIT", 10 | "dependencies": { 11 | "@openzeppelin/contracts": "^4.9.3", 12 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", 13 | "@nomiclabs/hardhat-ethers": "^2.2.2", 14 | "hardhat": "^2.13.0" 15 | } 16 | } -------------------------------------------------------------------------------- /campaigns/standalone-quests/static-call-detection/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts_' 3 | out = 'artifacts' 4 | script = 'script' 5 | libs = [ 6 | 'lib', 7 | '../../../lib', 8 | '../../../node_modules', 9 | ] 10 | solc_version = '0.8.19' 11 | remappings = [ 12 | 'test/=test/' 13 | ] 14 | no_match_path = "contracts_/utils/*.sol" 15 | 16 | [rpc_endpoints] 17 | sepolia = 'https://rpc-sepolia-eth.nodeguardians.io' 18 | 19 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/standalone-quests/using-signatures/contracts/Grandmasters.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./interfaces/IGrandmasters.sol"; 5 | 6 | contract Grandmasters is IGrandmasters { 7 | 8 | mapping(address => bool) public override grandmasters; 9 | 10 | constructor() payable { } 11 | 12 | function acceptInvite(bytes calldata signature) external override { } 13 | 14 | function receiveBlessing(uint256 amount, bytes calldata signature) external override { } 15 | 16 | } -------------------------------------------------------------------------------- /campaigns/understanding-storage/storage-efficiency/contracts/Elegy2.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | contract Elegy2 { 5 | 6 | uint32[] public lines; 7 | uint public totalSum; 8 | 9 | constructor(uint32[] memory _lines) { 10 | lines = _lines; 11 | } 12 | 13 | function play(uint nonce) external { 14 | totalSum = 0; 15 | for(uint i = 0; i < lines.length; i++) { 16 | totalSum += (i * nonce) * lines[i]; 17 | } 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /campaigns/understanding-storage/storage-efficiency/test/data/songs.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "lines": [ 4 | 25021323, 62912, 98122, 1231, 4088, 7873, 239, 191, 3941, 12, 91240, 1234901, 12390121, 1234101, 1412, 39013241 5 | ], 6 | "nonce": 5, 7 | "gasLimit": 40000 8 | }, 9 | { 10 | "lines": [ 11 | 85831, 391, 8120, 1231, 4081, 7673, 101010, 191, 3293211, 121, 13401, 3213, 4921, 11 12 | ], 13 | "nonce": 5, 14 | "gasLimit": 38000 15 | } 16 | ] -------------------------------------------------------------------------------- /campaigns/learning-assembly/memory-manipulation/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts' 3 | out = 'artifacts' 4 | libs = ['lib', '../../../lib', '../../..'] 5 | solc_version = '0.8.19' 6 | fs_permissions = [ 7 | { access = 'read', path = './test/data' }, 8 | { access = 'read', path = './artifacts' } 9 | ] 10 | remappings = [ 11 | "test/=test/" 12 | ] 13 | optimizer = false 14 | no_match_path = "contracts/test/TestProbe.sol" 15 | 16 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/standalone-quests/using-signatures/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "using-signatures", 3 | "version": "2.0.1", 4 | "scripts": { 5 | "test": "hardhat test --network hardhat && forge test", 6 | "test:hardhat": "hardhat test --network hardhat" 7 | }, 8 | "author": "", 9 | "license": "MIT", 10 | "dependencies": { 11 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", 12 | "@nomiclabs/hardhat-ethers": "^2.2.2", 13 | "@openzeppelin/contracts": "^4.9.3", 14 | "hardhat": "^2.13.0" 15 | } 16 | } -------------------------------------------------------------------------------- /campaigns/understanding-storage/storage-layout/contracts_/Temple.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | pragma solidity ^0.8.19; 3 | 4 | contract Temple { 5 | uint128 public entrance; 6 | address public mainHall; 7 | mapping(uint8 => mapping(uint8 => address)) public gardens; 8 | bytes20[] public chambers; 9 | 10 | /// Write data to the contract's ith storage slot 11 | function write(uint256 i, bytes32 data) public { 12 | assembly { 13 | sstore(i, data) 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/multicall/test/foundry/Multicall.2.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./testsuites/TestMulticall.sol"; 5 | import "../../contracts/GreaterArchives.sol"; 6 | 7 | contract PublicTest1 is TestMulticall { 8 | 9 | string PATH = "test/data/multicall.json"; 10 | constructor() TestMulticall(_archives(), _archives(), PATH) { } 11 | 12 | function _archives() private returns (address) { 13 | return address(new GreaterArchives()); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/state-channels/test/foundry/MineCart.2.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./testsuites/TestMineCart.sol"; 5 | 6 | contract PublicTest1 is TestMineCart { 7 | string PATH = "test/data/mineCart.json"; 8 | string KEY = "[0]"; 9 | constructor() TestMineCart(PATH, KEY) { } 10 | } 11 | 12 | contract PublicTest2 is TestMineCart { 13 | string PATH = "test/data/mineCart.json"; 14 | string KEY = "[1]"; 15 | constructor() TestMineCart(PATH, KEY) { } 16 | } -------------------------------------------------------------------------------- /campaigns/standalone-quests/multicall/test/foundry/GreatScribe.1.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./testsuites/TestGreatScribe.sol"; 5 | import "../../contracts/GreatArchives.sol"; 6 | 7 | contract PublicTest1 is TestGreatScribe { 8 | 9 | string PATH = "test/data/greatScribe.json"; 10 | constructor() TestGreatScribe(_archives(), _archives(), PATH) { } 11 | 12 | function _archives() private returns (address) { 13 | return address(new GreatArchives()); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/setting-up/test/foundry/HelloGuardian.3.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "../../contracts/HelloGuardian.sol"; 5 | import "forge-std/Test.sol"; 6 | 7 | contract PublicTest1 is Test { 8 | 9 | function testSayHello() external { 10 | HelloGuardian helloGuardian = new HelloGuardian(); 11 | 12 | assertEq( 13 | helloGuardian.hello(), 14 | "Hello Guardian", 15 | "Incorrect Result" 16 | ); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/vanity-theft/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts_' 3 | out = 'artifacts' 4 | script = 'script' 5 | libs = [ 6 | 'lib', 7 | '../../../lib', 8 | 'node_modules', 9 | '../../../node_modules' 10 | ] 11 | solc_version = '0.8.19' 12 | remappings = [ 13 | 'test/=test/' 14 | ] 15 | no_match_path = "contracts_/utils/*.sol" 16 | 17 | [rpc_endpoints] 18 | sepolia = 'https://rpc-sepolia-eth.nodeguardians.io' 19 | 20 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/standalone-quests/wtf-imps/contracts/test/TestImp.sol: -------------------------------------------------------------------------------- 1 | ///// 2 | // RULE: This file is for test purposees. 3 | // No modifying this file! 4 | ///// 5 | 6 | // SPDX-License-Identifier: MIT 7 | pragma solidity ^0.8.19; 8 | 9 | import { Imp } from "../Imp.sol"; 10 | 11 | contract TestImp { 12 | 13 | function villager() external pure returns (Imp.Target) { 14 | return Imp.Target.Villager; 15 | } 16 | 17 | function self() external pure returns (Imp.Target) { 18 | return Imp.Target.Self; 19 | } 20 | 21 | } -------------------------------------------------------------------------------- /campaigns/understanding-storage/storage-efficiency/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "storage-efficiency", 3 | "version": "2.0.1", 4 | "scripts": { 5 | "test": "hardhat test --network hardhat && forge test", 6 | "test:hardhat": "hardhat test --network hardhat" 7 | }, 8 | "author": "", 9 | "license": "MIT", 10 | "dependencies": { 11 | "@node-guardians/ng-quests-helpers": "^1.0.0", 12 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", 13 | "@nomiclabs/hardhat-ethers": "^2.2.2", 14 | "hardhat": "^2.13.0" 15 | } 16 | } -------------------------------------------------------------------------------- /campaigns/standalone-quests/elliptic-curve/test/foundry/FieldElement.1.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./testsuites/TestFieldElement.sol"; 5 | 6 | contract PublicTest1 is TestFelt { 7 | string PATH = "test/data/feltOperations.json"; 8 | string KEY = "[0]"; 9 | constructor() TestFelt(PATH, KEY) { } 10 | } 11 | 12 | contract PublicTest2 is TestFelt { 13 | string PATH = "test/data/feltOperations.json"; 14 | string KEY = "[1]"; 15 | constructor() TestFelt(PATH, KEY) { } 16 | } 17 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/emergency-governance/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts_' 3 | out = 'artifacts' 4 | script = 'script' 5 | libs = [ 6 | 'lib', 7 | '../../../lib', 8 | 'node_modules/', 9 | '../../../node_modules' 10 | ] 11 | solc_version = '0.8.19' 12 | remappings = [ 13 | 'test/=test/' 14 | ] 15 | no_match_path = "contracts_/*.sol" 16 | 17 | [rpc_endpoints] 18 | sepolia = 'https://rpc-sepolia-eth.nodeguardians.io' 19 | 20 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/standalone-quests/merkle-proofs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "merkle-proofs", 3 | "version": "2.0.1", 4 | "scripts": { 5 | "test": "hardhat test --network hardhat && forge test", 6 | "test:hardhat": "hardhat test --network hardhat" 7 | }, 8 | "author": "", 9 | "license": "MIT", 10 | "dependencies": { 11 | "merkletreejs": "^0.3.10", 12 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", 13 | "@nomiclabs/hardhat-ethers": "^2.2.2", 14 | "hardhat": "^2.13.0" 15 | } 16 | } -------------------------------------------------------------------------------- /campaigns/standalone-quests/setting-up/test/foundry/Submission.4.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "../../contracts/HelloGuardian.sol"; 5 | import "forge-std/Test.sol"; 6 | 7 | contract PublicTest1 is Test { 8 | 9 | function testReadyToSubmit() external { 10 | HelloGuardian helloGuardian = new HelloGuardian(); 11 | 12 | assertEq( 13 | helloGuardian.hello(), 14 | "Hello Guardian", 15 | "Incorrect Result" 16 | ); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /campaigns/learning-assembly/bits-and-bytes/test/foundry/Scrambled.4.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./testsuites/TestScrambled.sol"; 5 | 6 | contract PublicTest1 is TestScrambled { 7 | string PATH = "test/data/scrambled.json"; 8 | string KEY = "[0]"; 9 | constructor() TestScrambled(PATH, KEY) { } 10 | } 11 | 12 | contract PublicTest2 is TestScrambled { 13 | string PATH = "test/data/scrambled.json"; 14 | string KEY = "[1]"; 15 | constructor() TestScrambled(PATH, KEY) { } 16 | } 17 | -------------------------------------------------------------------------------- /campaigns/playing-with-op-stack/create-op-rollup/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts_' 3 | out = 'artifacts' 4 | script = 'script' 5 | libs = [ 6 | 'lib', 7 | '../../../lib', 8 | 'node_modules/', 9 | '../../../node_modules/' 10 | ] 11 | 12 | auto_detect_solc = true 13 | remappings = [ 14 | 'test/=test/' 15 | ] 16 | no_match_path = "contracts_/utils/*.sol" 17 | 18 | [rpc_endpoints] 19 | sepolia = 'https://sepolia.nodeguardians.io' 20 | 21 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/learning-assembly/yul-basics/test/data/comparisons.json: -------------------------------------------------------------------------------- 1 | { 2 | "isZero": [0, 1], 3 | "greaterThan": [ 4 | { "x": 1, "y": 0 }, 5 | { "x": 1, "y": 2 } 6 | ], 7 | "signedLowerThan": [ 8 | { "x": -1, "y": 0 }, 9 | { "x": 1, "y": -1 } 10 | ], 11 | "isNegativeOrEqualTen": [1, -10, 0, 10, 11], 12 | "isInRange": [ 13 | { "x": 0, "y": 11, "z": 12 }, 14 | { "x": 10, "y": 9, "z": 10 }, 15 | { "x": 10, "y": 8, "z": 9 }, 16 | { "x": 10, "y": 10, "z": 11 } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/flashloan-counterexploit/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts_' 3 | out = 'artifacts' 4 | script = 'script' 5 | libs = [ 6 | 'lib', 7 | '../../../lib', 8 | 'node_modules', 9 | '../../../node_modules' 10 | ] 11 | solc_version = '0.8.19' 12 | remappings = [ 13 | 'test/=test/' 14 | ] 15 | no_match_path = "contracts_/utils/*.sol" 16 | 17 | [rpc_endpoints] 18 | sepolia = 'https://rpc-sepolia-eth.nodeguardians.io' 19 | 20 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/standalone-quests/interactive-fraud-proofs/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts_' 3 | out = 'artifacts' 4 | script = 'script' 5 | libs = [ 6 | 'lib', 7 | '../../../lib', 8 | 'node_modules', 9 | '../../../node_modules' 10 | ] 11 | solc_version = '0.8.19' 12 | remappings = [ 13 | 'test/=test/' 14 | ] 15 | no_match_path = "contracts_/utils/*.sol" 16 | 17 | [rpc_endpoints] 18 | sepolia = 'https://rpc-sepolia-eth.nodeguardians.io' 19 | 20 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/standalone-quests/elliptic-curve/test/foundry/CurveOperations.2.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./testsuites/TestCurveOps.sol"; 5 | 6 | contract PublicTest1 is TestCurveOps { 7 | string PATH = "test/data/curveOperations.json"; 8 | string KEY = "[0]"; 9 | constructor() TestCurveOps(PATH, KEY) { } 10 | } 11 | 12 | contract PublicTest2 is TestCurveOps { 13 | string PATH = "test/data/curveOperations.json"; 14 | string KEY = "[1]"; 15 | constructor() TestCurveOps(PATH, KEY) { } 16 | } 17 | -------------------------------------------------------------------------------- /campaigns/building-on-zksync/zksync-contracts/contracts/Lungs.sol: -------------------------------------------------------------------------------- 1 | //SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import { 5 | DEPLOYER_SYSTEM_CONTRACT, 6 | IContractDeployer 7 | } from "@matterlabs/zksync-contracts/l2/system-contracts/Constants.sol"; 8 | import "@matterlabs/zksync-contracts/l2/system-contracts/libraries/SystemContractHelper.sol"; 9 | 10 | contract Lungs { 11 | 12 | address public lastRoar; 13 | 14 | function roar(bytes32 _bytecodeHash) external { 15 | // TODO: Implement this function 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /campaigns/learning-assembly/bits-and-bytes/test/foundry/BitOperators.1.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./testsuites/TestBitOperators.sol"; 5 | 6 | contract PublicTest1 is TestBitOperators { 7 | string PATH = "test/data/bitOperators.json"; 8 | string KEY = "[0]"; 9 | constructor() TestBitOperators(PATH, KEY) { } 10 | } 11 | 12 | contract PublicTest2 is TestBitOperators { 13 | string PATH = "test/data/bitOperators.json"; 14 | string KEY = "[1]"; 15 | constructor() TestBitOperators(PATH, KEY) { } 16 | } -------------------------------------------------------------------------------- /campaigns/standalone-quests/merkle-proofs/contracts/SacredTree.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | contract SacredTree { 5 | 6 | bytes32 public root; // PART 1: STORE ROOT HERE 7 | 8 | /// Verify that an address is trusted by the tree. 9 | /// @param trustee Address to verify 10 | /// @param proof Merkle proof for verification 11 | function verify( 12 | address trustee, 13 | bytes32[] calldata proof) 14 | external view returns (bool) { 15 | // PART 2: CODE HERE 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/quadratic-public-goods/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "quadratic-public-goods", 3 | "version": "2.0.0", 4 | "scripts": { 5 | "test": "hardhat test --network hardhat && forge test", 6 | "test:hardhat": "hardhat test --network hardhat" 7 | }, 8 | "author": "", 9 | "license": "MIT", 10 | "dependencies": { 11 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", 12 | "@nomiclabs/hardhat-ethers": "^2.2.2", 13 | "@nomicfoundation/hardhat-network-helpers": "^1.0.8", 14 | "hardhat": "^2.13.0" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /campaigns/building-on-zksync/zksync-accounts/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomicfoundation/hardhat-chai-matchers"); 2 | require("@matterlabs/hardhat-zksync-node"); 3 | require("@matterlabs/hardhat-zksync-deploy"); 4 | require("@matterlabs/hardhat-zksync-solc"); 5 | 6 | module.exports = { 7 | defaultNetwork: "hardhat", 8 | networks: { 9 | hardhat: { 10 | zksync: true, 11 | }, 12 | }, 13 | zksolc: { 14 | version: "1.4.1", 15 | settings: { 16 | isSystem: true, 17 | }, 18 | }, 19 | solidity: { 20 | version: "0.8.19", 21 | }, 22 | }; 23 | -------------------------------------------------------------------------------- /campaigns/learning-assembly/bits-and-bytes/test/data/maskGenerator.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "nBytes": 2, 4 | "at": 0, 5 | "reversed": false, 6 | "expectedMask": "0x000000000000000000000000000000000000000000000000000000000000FFFF" 7 | }, 8 | { 9 | "nBytes": 17, 10 | "at": 3, 11 | "reversed": false, 12 | "expectedMask": "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000" 13 | }, 14 | { 15 | "nBytes": 20, 16 | "at": 13, 17 | "reversed": false, 18 | "expectedMask": 0 19 | } 20 | ] -------------------------------------------------------------------------------- /campaigns/proxy-contracts/basic-proxies/contracts/UpgradeableMechSuit.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | contract UpgradeableMechSuit { 5 | 6 | /// @notice Constructs the contract 7 | /// @param _implementation Address of logic contract to be linked 8 | constructor(address _implementation) { } 9 | 10 | /// @notice Upgrades contract by updating the linked logic contract 11 | /// @param _implementation Address of new logic contract to be linked 12 | function upgradeTo(address _implementation) external { } 13 | 14 | } -------------------------------------------------------------------------------- /campaigns/gas-golfing-s1/roman-numerals/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts' 3 | out = 'artifacts' 4 | libs = ['lib', '../../../lib', '../../../node_modules'] 5 | solc_version = '0.8.19' 6 | optimizer_runs = 800 7 | remappings = [ "test/=test/" ] 8 | fs_permissions = [ 9 | { access = 'read', path = './test/data' }, 10 | { access = 'read-write', path = './history.json' }, 11 | { access = 'read-write', path = './metrics.json' } 12 | ] 13 | gas_reports = ["Challenge"] 14 | 15 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/learning-assembly/memory-manipulation/test/data/dynamicArray.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "push": { 4 | "array": [1, 2, 3], 5 | "value": 4 6 | }, 7 | "pop": [ 1, 5, 2 ], 8 | "popAt": { 9 | "array": [1, 5, 2, 1], 10 | "value": 1 11 | } 12 | }, 13 | { 14 | "push": { 15 | "array": [ ], 16 | "value": 1 17 | }, 18 | "pop": [ ], 19 | "popAt": { 20 | "array": [1, 2, 3], 21 | "value": 3 22 | } 23 | } 24 | ] -------------------------------------------------------------------------------- /campaigns/standalone-quests/finding-ouroboros/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts_' 3 | out = 'artifacts' 4 | script = 'script' 5 | libs = [ 6 | 'lib', 7 | '../../../lib', 8 | 'node_modules', 9 | '../../../node_modules' 10 | ] 11 | solc_version = '0.8.19' 12 | remappings = [ 13 | 'test/=test/' 14 | ] 15 | no_match_path = "contracts_/utils/*.sol" 16 | evm_version = "shanghai" 17 | 18 | [rpc_endpoints] 19 | sepolia = 'https://rpc-sepolia-eth.nodeguardians.io' 20 | 21 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/standalone-quests/finding-ouroboros/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "finding-ouroboros", 3 | "version": "1.1.0", 4 | "scripts": { 5 | "test": "forge test", 6 | "deploy": "hardhat run ../../../scripts/deploy-validator.js --network sepolia" 7 | }, 8 | "author": "", 9 | "license": "MIT", 10 | "dependencies": { 11 | "@node-guardians/ng-quests-contracts": "^1.0.0", 12 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", 13 | "@nomiclabs/hardhat-ethers": "^2.2.2", 14 | "hardhat": "^2.13.0" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/merkle-proofs/test/foundry/SacredTree.2.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./testsuites/TestTree.sol"; 5 | 6 | contract PublicTest1 is TestTree { 7 | 8 | string DATA_PATH = "test/data/proofs.json"; 9 | string DATA_KEY = "[0]"; 10 | constructor() TestTree(DATA_PATH, DATA_KEY) { } 11 | 12 | } 13 | 14 | contract PublicTest2 is TestTree { 15 | 16 | string DATA_PATH = "test/data/proofs.json"; 17 | string DATA_KEY = "[1]"; 18 | constructor() TestTree(DATA_PATH, DATA_KEY) { } 19 | 20 | } -------------------------------------------------------------------------------- /campaigns/building-on-zksync/zksync-contracts/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomicfoundation/hardhat-chai-matchers"); 2 | require("@matterlabs/hardhat-zksync-node"); 3 | require("@matterlabs/hardhat-zksync-deploy"); 4 | require("@matterlabs/hardhat-zksync-solc"); 5 | 6 | module.exports = { 7 | defaultNetwork: "hardhat", 8 | networks: { 9 | hardhat: { 10 | zksync: true, 11 | }, 12 | }, 13 | zksolc: { 14 | version: "1.4.1", 15 | settings: { 16 | isSystem: true, 17 | }, 18 | }, 19 | solidity: { 20 | version: "0.8.19", 21 | }, 22 | }; 23 | 24 | -------------------------------------------------------------------------------- /campaigns/building-on-zksync/zksync-paymasters/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomicfoundation/hardhat-chai-matchers"); 2 | require("@matterlabs/hardhat-zksync-node"); 3 | require("@matterlabs/hardhat-zksync-deploy"); 4 | require("@matterlabs/hardhat-zksync-solc"); 5 | 6 | module.exports = { 7 | defaultNetwork: "hardhat", 8 | networks: { 9 | hardhat: { 10 | zksync: true, 11 | }, 12 | }, 13 | zksolc: { 14 | version: "1.4.1", 15 | settings: { 16 | isSystem: true, 17 | }, 18 | }, 19 | solidity: { 20 | version: "0.8.19", 21 | }, 22 | }; 23 | 24 | -------------------------------------------------------------------------------- /campaigns/learning-assembly/memory-manipulation/test/foundry/DynamicArray.4.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./testsuites/TestDynamicArray.sol"; 5 | 6 | contract PublicTest1 is TestDynamicArray { 7 | string PATH = "test/data/dynamicArray.json"; 8 | string KEY = "[0]"; 9 | constructor() TestDynamicArray(PATH, KEY) { } 10 | } 11 | 12 | contract PublicTest2 is TestDynamicArray { 13 | string PATH = "test/data/dynamicArray.json"; 14 | string KEY = "[1]"; 15 | constructor() TestDynamicArray(PATH, KEY) { } 16 | } 17 | -------------------------------------------------------------------------------- /campaigns/learning-assembly/memory-manipulation/test/foundry/MemoryLayout.3.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./testsuites/TestMemoryLayout.sol"; 5 | 6 | contract PublicTest1 is TestMemoryLayout { 7 | string PATH = "test/data/memoryLayout.json"; 8 | string KEY = "[0]"; 9 | constructor() TestMemoryLayout(PATH, KEY) { } 10 | } 11 | 12 | contract PublicTest2 is TestMemoryLayout { 13 | string PATH = "test/data/memoryLayout.json"; 14 | string KEY = "[1]"; 15 | constructor() TestMemoryLayout(PATH, KEY) { } 16 | } 17 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/self-hosted-evm/test/foundry/Instructions.4.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./testsuites/TestInstructions.sol"; 5 | 6 | contract PublicTest1 is TestInstructions { 7 | string PATH = "test/data/instructions.json"; 8 | string KEY = "[0]"; 9 | 10 | constructor() TestInstructions(PATH, KEY) {} 11 | } 12 | 13 | contract PublicTest2 is TestInstructions { 14 | string PATH = "test/data/instructions.json"; 15 | string KEY = "[1]"; 16 | 17 | constructor() TestInstructions(PATH, KEY) {} 18 | } 19 | -------------------------------------------------------------------------------- /campaigns/gas-golfing-s1/changing-base/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts' 3 | out = 'artifacts' 4 | libs = ['lib', '../../../lib', '../../../node_modules'] 5 | solc_version = '0.8.19' 6 | optimizer_runs = 800 7 | remappings = [ 8 | "test/=test/" 9 | ] 10 | fs_permissions = [ 11 | { access = 'read', path = './test/data' }, 12 | { access = 'read-write', path = './history.json' }, 13 | { access = 'read-write', path = './metrics.json' } 14 | ] 15 | gas_reports = ["Challenge"] 16 | 17 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/proxy-contracts/basic-proxies/contracts/MechSuitV1.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | contract MechSuitV1 { 5 | 6 | // Space reserved for UpgradeableMechSuit to store delegate address 7 | bytes32 private DO_NOT_USE; 8 | 9 | uint32 public fuel; 10 | 11 | function swingHammer() external returns (bytes32) { 12 | fuel -= 10; 13 | return keccak256("HAMMER SMASH!!!"); 14 | } 15 | 16 | function refuel() external payable { 17 | require(msg.value == 1 gwei); 18 | fuel = 100; 19 | } 20 | 21 | } -------------------------------------------------------------------------------- /campaigns/proxy-contracts/proxy-security/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "proxy-security", 3 | "version": "2.0.0", 4 | "scripts": { 5 | "test": "hardhat test --network hardhat && forge build", 6 | "deploy": "hardhat run ../../../scripts/deploy-validator.js --network sepolia" 7 | }, 8 | "author": "", 9 | "license": "MIT", 10 | "dependencies": { 11 | "@node-guardians/ng-quests-contracts": "^1.0.0", 12 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", 13 | "@nomiclabs/hardhat-ethers": "^2.2.2", 14 | "dotenv": "^16.0.3", 15 | "hardhat": "^2.13.0" 16 | } 17 | } -------------------------------------------------------------------------------- /campaigns/randomness/breaking-rng/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "breaking-rng", 3 | "version": "1.1.2", 4 | "scripts": { 5 | "test": "hardhat test --network hardhat && forge build", 6 | "deploy": "hardhat run ../../../scripts/deploy-validator.js --network sepolia" 7 | }, 8 | "author": "", 9 | "license": "MIT", 10 | "dependencies": { 11 | "@node-guardians/ng-quests-contracts": "^1.0.0", 12 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", 13 | "@nomiclabs/hardhat-ethers": "^2.2.2", 14 | "dotenv": "^16.0.3", 15 | "hardhat": "^2.13.0" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/interactive-fraud-proofs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "interactive-fraud-proofs", 3 | "version": "1.0.0", 4 | "scripts": { 5 | "test": "forge test", 6 | "deploy": "hardhat run ../../../scripts/deploy-validator.js --network sepolia" 7 | }, 8 | "author": "", 9 | "license": "MIT", 10 | "dependencies": { 11 | "@node-guardians/ng-quests-contracts": "^1.0.0", 12 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", 13 | "@nomiclabs/hardhat-ethers": "^2.2.2", 14 | "hardhat": "^2.13.0" 15 | } 16 | } -------------------------------------------------------------------------------- /campaigns/standalone-quests/self-hosted-evm/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts' 3 | out = 'artifacts' 4 | script = 'script' 5 | test = 'test/foundry' 6 | libs = [ 7 | 'lib', 8 | '../../../lib', 9 | ] 10 | fs_permissions = [ 11 | { access = 'read', path = './test/data' } 12 | ] 13 | remappings = [ 14 | "test/=test/" 15 | ] 16 | solc_version = '0.8.19' 17 | ignored_error_codes = [9432, 5574] 18 | [rpc_endpoints] 19 | sepolia = 'https://rpc-sepolia-eth.nodeguardians.io' 20 | 21 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config 22 | -------------------------------------------------------------------------------- /campaigns/diamonds/building-diamonds/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "building-diamonds", 3 | "version": "2.0.0", 4 | "scripts": { 5 | "test": "hardhat test --network hardhat && forge test", 6 | "test:hardhat": "hardhat test --network hardhat" 7 | }, 8 | "author": "", 9 | "license": "MIT", 10 | "dependencies": { 11 | "@node-guardians/ng-quests-helpers": "^1.0.0", 12 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", 13 | "@nomiclabs/hardhat-ethers": "^2.2.2", 14 | "hardhat": "^2.13.0", 15 | "chai": "^4.3.4" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /campaigns/gas-golfing-s1/remove-duplicates/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts' 3 | out = 'artifacts' 4 | libs = ['lib', '../../../lib', '../../../node_modules'] 5 | solc_version = '0.8.19' 6 | optimizer_runs = 800 7 | remappings = [ 8 | "test/=test/" 9 | ] 10 | fs_permissions = [ 11 | { access = 'read', path = './test/data' }, 12 | { access = 'read-write', path = './history.json' }, 13 | { access = 'read-write', path = './metrics.json' } 14 | ] 15 | gas_reports = ["Challenge"] 16 | 17 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/learning-assembly/yul-basics/contracts/Switch.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | contract Switch { 5 | 6 | /// @notice Maps the given id to a corresponding direction. 7 | /// Returns "left" if id % 4 == 0. 8 | /// Returns "right" if id % 4 == 1. 9 | /// Returns "forward" if id % 4 == 2. 10 | /// Returns "backward" if id % 4 == 3. 11 | function getDirection(uint256 id) 12 | public 13 | pure 14 | returns (bytes8 direction) 15 | { 16 | assembly { 17 | 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/low-level-calls/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "low-level-calls", 3 | "version": "1.1.1", 4 | "scripts": { 5 | "test": "hardhat test --network hardhat && forge build", 6 | "deploy": "hardhat run ../../../scripts/deploy-validator.js --network sepolia" 7 | }, 8 | "author": "", 9 | "license": "MIT", 10 | "dependencies": { 11 | "@node-guardians/ng-quests-contracts": "^1.0.0", 12 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", 13 | "@nomiclabs/hardhat-ethers": "^2.2.2", 14 | "dotenv": "^16.0.3", 15 | "hardhat": "^2.13.0" 16 | } 17 | } -------------------------------------------------------------------------------- /campaigns/standalone-quests/self-hosted-evm/contracts/test/helpers/Create.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.16; 3 | 4 | contract Create { 5 | 6 | // solc-ignore-next-line unused-param 7 | function create(bytes memory cdata) public payable returns (address addr) { 8 | assembly { 9 | addr := create(callvalue(), add(cdata, 0x20), mload(cdata)) 10 | 11 | if iszero(addr) { 12 | returndatacopy(0, 0, returndatasize()) 13 | revert(0, returndatasize()) 14 | } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /campaigns/gas-golfing-s1/internal-representation/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts' 3 | out = 'artifacts' 4 | libs = ['lib', '../../../lib', '../../../node_modules'] 5 | solc_version = '0.8.19' 6 | optimizer_runs = 800 7 | remappings = [ 8 | "test/=test/" 9 | ] 10 | fs_permissions = [ 11 | { access = 'read', path = './test/data' }, 12 | { access = 'read-write', path = './history.json' }, 13 | { access = 'read-write', path = './metrics.json' } 14 | ] 15 | gas_reports = ["Challenge"] 16 | 17 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/learning-assembly/yul-basics/contracts/For.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | contract For { 5 | 6 | /// @notice Sum the elements in [`beg`, `end`) and return the result. 7 | /// Skips elements divisible by 5. 8 | /// Exits the summation loop when it encounters a factor of `end`. 9 | /// @dev You can ignore overflow / underflow bugs. 10 | function sumElements(uint256 beg, uint256 end) 11 | public 12 | pure 13 | returns (uint256 sum) 14 | { 15 | assembly { 16 | 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /campaigns/learning-assembly/yul-basics/contracts/If.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | contract If { 5 | 6 | /// @notice Converts minutes to hours. 7 | /// Reverts if _minutes is negative or not divisible by 60. 8 | /// @param _minutes the number of minutes to convert to hours. 9 | /// @return _hours the number of hours represented by _minutes. 10 | function minutesToHours(int256 _minutes) 11 | public 12 | pure 13 | returns (uint256 _hours) 14 | { 15 | assembly { 16 | 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /campaigns/playing-with-op-stack/cross-layer-secrets/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts_' 3 | out = 'artifacts' 4 | script = 'script' 5 | libs = [ 6 | 'lib', 7 | '../../../lib', 8 | 'node_modules/', 9 | '../../../node_modules/' 10 | ] 11 | 12 | auto_detect_solc = true 13 | remappings = [ 14 | 'test/=test/' 15 | ] 16 | no_match_path = "contracts_/utils/*.sol" 17 | 18 | [rpc_endpoints] 19 | sepolia = 'https://sepolia.nodeguardians.io' 20 | op-sepolia = 'https://sepolia.optimism.io' 21 | 22 | # See more config options https://github.com/foundry-rs/foundry/tree/master/config -------------------------------------------------------------------------------- /campaigns/standalone-quests/delegate-call-detection/contracts/test/TestProbe.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | contract TestProbe { 5 | 6 | function delegateCall(address target) external returns (bool) { 7 | 8 | (bool result, bytes memory _returnData) = target.delegatecall( 9 | abi.encodeWithSignature("isDelegateCall()") 10 | ); 11 | 12 | require(result, "Delegate call failed"); 13 | 14 | bool isDelegate = abi.decode(_returnData, (bool)); 15 | 16 | return isDelegate; 17 | 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /campaigns/understanding-storage/storage-layout/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "storage-layout", 3 | "version": "1.1.1", 4 | "scripts": { 5 | "test": "hardhat test --network hardhat && forge build", 6 | "deploy": "hardhat run ../../../scripts/deploy-validator.js --network sepolia" 7 | }, 8 | "author": "", 9 | "license": "MIT", 10 | "dependencies": { 11 | "@node-guardians/ng-quests-contracts": "^1.0.0", 12 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", 13 | "@nomiclabs/hardhat-ethers": "^2.2.2", 14 | "dotenv": "^16.0.3", 15 | "hardhat": "^2.13.0" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /campaigns/learning-assembly/memory-manipulation/test/data/memoryLayout.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "createUint256Array": { 4 | "size": 0, 5 | "value": 0 6 | }, 7 | "createBytesArray": { 8 | "size": 0, 9 | "value": 0 10 | } 11 | }, 12 | { 13 | "createUint256Array": { 14 | "size": 0, 15 | "value": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" 16 | }, 17 | "createBytesArray": { 18 | "size": 0, 19 | "value": 255 20 | } 21 | } 22 | ] -------------------------------------------------------------------------------- /campaigns/standalone-quests/merkle-proofs/test/foundry/SacredTree.1.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "forge-std/Test.sol"; 5 | import "../../contracts/SacredTree.sol"; 6 | 7 | contract PublicTest1 is Test { 8 | 9 | bytes32 constant ROOT_HASH = 0xbd150162dead740efc1f898cae744c69ccf898415b98d8c95e9ae7116361796c; 10 | function test_correct_root() external { 11 | SacredTree tree = new SacredTree(); 12 | bytes32 root = tree.root(); 13 | 14 | assertEq(keccak256(abi.encode(root)), ROOT_HASH, "Incorrect root"); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /campaigns/get-rekt/cream-rekt/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomiclabs/hardhat-ethers"); 2 | require("@nomicfoundation/hardhat-chai-matchers"); 3 | 4 | require("dotenv").config({ path: "../../../.env" }); 5 | 6 | /** 7 | * @type import('hardhat/config').HardhatUserConfig 8 | */ 9 | module.exports = { 10 | solidity: "0.8.19", 11 | defaultNetwork: "hardhat", 12 | networks: { 13 | hardhat: {}, 14 | sepolia: { 15 | url: "https://rpc-sepolia-eth.nodeguardians.io", 16 | accounts: [process.env.PRIVATE_KEY], 17 | }, 18 | }, 19 | paths: { 20 | sources: "./contracts_", 21 | }, 22 | }; 23 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/flashloan-counterexploit/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomiclabs/hardhat-ethers"); 2 | require("@nomicfoundation/hardhat-chai-matchers"); 3 | 4 | require("dotenv").config({ path: "../../../.env" }); 5 | 6 | /** 7 | * @type import('hardhat/config').HardhatUserConfig 8 | */ 9 | module.exports = { 10 | solidity: "0.8.19", 11 | defaultNetwork: "hardhat", 12 | networks: { 13 | sepolia: { 14 | url: "https://rpc-sepolia-eth.nodeguardians.io", 15 | accounts: [process.env.PRIVATE_KEY], 16 | }, 17 | }, 18 | paths: { 19 | sources: "./contracts_", 20 | }, 21 | }; 22 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/hardhat-forking/contracts/RubyQuarry.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./QuarryBase.sol"; 5 | 6 | contract RubyQuarry is QuarryBase { 7 | 8 | bytes32 private ownerHash 9 | = 0x4f8bf104764038194a9323a9b61e2806a8370b9cfbe823f5a511062bf189b9d5; 10 | 11 | function dig() external view returns (string memory treasure) { 12 | 13 | bytes32 senderHash = keccak256(abi.encodePacked(msg.sender)); 14 | require(senderHash == ownerHash, "Caller must be owner"); 15 | 16 | return super._dig(); 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /campaigns/standalone-quests/vanity-theft/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vanity-theft", 3 | "version": "1.0.0", 4 | "scripts": { 5 | "test": "forge test", 6 | "deploy": "hardhat run ../../../scripts/deploy-validator.js --network sepolia && hardhat run scripts/deployVault.js --network sepolia" 7 | }, 8 | "author": "", 9 | "license": "MIT", 10 | "dependencies": { 11 | "@node-guardians/ng-quests-contracts": "^1.0.0", 12 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", 13 | "@nomiclabs/hardhat-ethers": "^2.2.2", 14 | "dotenv": "^16.0.3", 15 | "hardhat": "^2.13.0" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /campaigns/diamonds/using-diamonds/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "using-diamonds", 3 | "version": "1.1.1", 4 | "scripts": { 5 | "test": "hardhat test --network hardhat && forge build", 6 | "deploy": "hardhat run scripts/deploy.js --network sepolia" 7 | }, 8 | "author": "", 9 | "license": "MIT", 10 | "dependencies": { 11 | "@node-guardians/ng-quests-contracts": "^1.0.0", 12 | "@node-guardians/ng-quests-helpers": "^1.0.0", 13 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", 14 | "@nomiclabs/hardhat-ethers": "^2.2.2", 15 | "dotenv": "^16.0.3", 16 | "hardhat": "^2.13.0" 17 | } 18 | } -------------------------------------------------------------------------------- /campaigns/get-rekt/wintermute-rekt/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomiclabs/hardhat-ethers"); 2 | require("@nomicfoundation/hardhat-chai-matchers"); 3 | 4 | require("dotenv").config({ path: "../../../.env" }); 5 | 6 | /** 7 | * @type import('hardhat/config').HardhatUserConfig 8 | */ 9 | module.exports = { 10 | solidity: "0.8.19", 11 | defaultNetwork: "hardhat", 12 | networks: { 13 | hardhat: {}, 14 | sepolia: { 15 | url: "https://rpc-sepolia-eth.nodeguardians.io", 16 | accounts: [process.env.PRIVATE_KEY], 17 | }, 18 | }, 19 | paths: { 20 | sources: "./contracts_", 21 | }, 22 | }; 23 | -------------------------------------------------------------------------------- /campaigns/randomness/breaking-rng/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomiclabs/hardhat-ethers"); 2 | require("@nomicfoundation/hardhat-chai-matchers"); 3 | 4 | require("dotenv").config({ path: "../../../.env" }); 5 | 6 | /** 7 | * @type import('hardhat/config').HardhatUserConfig 8 | */ 9 | module.exports = { 10 | solidity: "0.8.19", 11 | defaultNetwork: "hardhat", 12 | networks: { 13 | hardhat: {}, 14 | sepolia: { 15 | url: "https://rpc-sepolia-eth.nodeguardians.io", 16 | accounts: [process.env.PRIVATE_KEY], 17 | }, 18 | }, 19 | paths: { 20 | sources: "./contracts_", 21 | }, 22 | }; 23 | -------------------------------------------------------------------------------- /campaigns/randomness/chainlink-vrf/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomiclabs/hardhat-ethers"); 2 | require("@nomicfoundation/hardhat-chai-matchers"); 3 | 4 | require("dotenv").config({ path: "../../../.env" }); 5 | 6 | /** 7 | * @type import('hardhat/config').HardhatUserConfig 8 | */ 9 | module.exports = { 10 | solidity: "0.8.19", 11 | defaultNetwork: "hardhat", 12 | networks: { 13 | hardhat: {}, 14 | sepolia: { 15 | url: "https://rpc-sepolia-eth.nodeguardians.io", 16 | accounts: [process.env.PRIVATE_KEY], 17 | }, 18 | }, 19 | paths: { 20 | sources: "./contracts_", 21 | }, 22 | }; 23 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/stealth-addresses/test/foundry/CursedGrimoires.2.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import "./testsuites/TestCursedGrimoires.sol"; 5 | 6 | contract PublicTest1 is TestCursedGrimoires { 7 | 8 | string PATH = "test/data/cursedGrimoires.json"; 9 | string KEY = "[0]"; 10 | constructor() TestCursedGrimoires(PATH, KEY) {} 11 | 12 | } 13 | 14 | contract PublicTest2 is TestCursedGrimoires { 15 | 16 | string PATH = "test/data/cursedGrimoires.json"; 17 | string KEY = "[1]"; 18 | constructor() TestCursedGrimoires(PATH, KEY) {} 19 | 20 | } -------------------------------------------------------------------------------- /campaigns/gas-golfing-s1/remove-duplicates/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "remove-duplicates", 3 | "version": "1.0.0", 4 | "scripts": { 5 | "test": "hardhat test --network hardhat && forge test", 6 | "test:hardhat": "hardhat test --network hardhat", 7 | "metrics": "hardhat run tasks/getMetrics.js" 8 | }, 9 | "author": "", 10 | "license": "MIT", 11 | "dependencies": { 12 | "@node-guardians/ng-quests-helpers": "^1.0.3", 13 | "@nomicfoundation/hardhat-toolbox": "^5.0.0", 14 | "@solidity-parser/parser": "^0.16.0", 15 | "chai-exclude": "^2.1.0", 16 | "hardhat": "^2.13.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /campaigns/proxy-contracts/proxy-security/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomiclabs/hardhat-ethers"); 2 | require("@nomicfoundation/hardhat-chai-matchers"); 3 | 4 | require("dotenv").config({ path: "../../../.env" }); 5 | 6 | /** 7 | * @type import('hardhat/config').HardhatUserConfig 8 | */ 9 | module.exports = { 10 | solidity: "0.8.19", 11 | defaultNetwork: "hardhat", 12 | networks: { 13 | hardhat: {}, 14 | sepolia: { 15 | url: "https://rpc-sepolia-eth.nodeguardians.io", 16 | accounts: [process.env.PRIVATE_KEY], 17 | }, 18 | }, 19 | paths: { 20 | sources: "./contracts_", 21 | }, 22 | }; 23 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/clone-factories/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "clone-factories", 3 | "version": "3.0.0", 4 | "scripts": { 5 | "test": "hardhat test --network hardhat && forge test", 6 | "test:hardhat": "hardhat test --network hardhat" 7 | }, 8 | "author": "", 9 | "license": "MIT", 10 | "dependencies": { 11 | "@node-guardians/ng-quests-helpers": "^1.0.0", 12 | "@openzeppelin/contracts": "^4.9.3", 13 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", 14 | "@nomiclabs/hardhat-ethers": "^2.2.2", 15 | "hardhat": "^2.13.0" 16 | } 17 | } -------------------------------------------------------------------------------- /campaigns/standalone-quests/multicall/contracts/Multicall.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | abstract contract Multicall { 5 | 6 | /** 7 | * @dev Executes a batch of function calls on this contract. 8 | * @param calls The sequence of ABI calldata of the transactions to forward to this contract. 9 | * 10 | * @return results Returns array of call results represented as bytes. 11 | */ 12 | function multicall( 13 | bytes[] calldata calls 14 | ) external virtual returns (bytes[] memory results) { 15 | // CODE HERE 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/self-hosted-evm/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomiclabs/hardhat-ethers"); 2 | require("@nomicfoundation/hardhat-chai-matchers"); 3 | require("hardhat-ignore-warnings"); 4 | 5 | /** 6 | * @type import('hardhat/config').HardhatUserConfig 7 | */ 8 | module.exports = { 9 | solidity: "0.8.19", 10 | networks: { 11 | hardhat: { 12 | allowUnlimitedContractSize: true, 13 | }, 14 | }, 15 | settings: { 16 | optimizer: { 17 | enabled: true, 18 | runs: 100, 19 | }, 20 | }, 21 | warnings: { 22 | "*": { 23 | "code-size": "off", 24 | }, 25 | }, 26 | }; 27 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/vanity-theft/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomiclabs/hardhat-ethers"); 2 | require("@nomicfoundation/hardhat-chai-matchers"); 3 | 4 | require("dotenv").config({ path: "../../../.env" }); 5 | 6 | /** 7 | * @type import('hardhat/config').HardhatUserConfig 8 | */ 9 | module.exports = { 10 | solidity: "0.8.19", 11 | defaultNetwork: "hardhat", 12 | networks: { 13 | hardhat: {}, 14 | sepolia: { 15 | url: "https://rpc-sepolia-eth.nodeguardians.io", 16 | accounts: [process.env.PRIVATE_KEY], 17 | }, 18 | }, 19 | paths: { 20 | sources: "./contracts_", 21 | }, 22 | }; 23 | -------------------------------------------------------------------------------- /campaigns/learning-assembly/bits-and-bytes/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "assembly-bits-and-bytes", 3 | "version": "2.0.0", 4 | "scripts": { 5 | "test": "hardhat test --network hardhat && forge test", 6 | "test:hardhat": "hardhat test --network hardhat" 7 | }, 8 | "author": "", 9 | "license": "MIT", 10 | "dependencies": { 11 | "@node-guardians/ng-quests-helpers": "^1.0.0", 12 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", 13 | "@nomiclabs/hardhat-ethers": "^2.2.2", 14 | "@solidity-parser/parser": "^0.16.0", 15 | "chai-exclude": "^2.1.0", 16 | "hardhat": "^2.13.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /campaigns/learning-assembly/memory-manipulation/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "memory-manipulation", 3 | "version": "2.0.1", 4 | "scripts": { 5 | "test": "hardhat test --network hardhat && forge test", 6 | "test:hardhat": "hardhat test --network hardhat" 7 | }, 8 | "author": "", 9 | "license": "MIT", 10 | "dependencies": { 11 | "@node-guardians/ng-quests-helpers": "^1.0.0", 12 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", 13 | "@nomiclabs/hardhat-ethers": "^2.2.2", 14 | "@solidity-parser/parser": "^0.16.0", 15 | "chai-exclude": "^2.1.0", 16 | "hardhat": "^2.13.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/low-level-calls/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomiclabs/hardhat-ethers"); 2 | require("@nomicfoundation/hardhat-chai-matchers"); 3 | 4 | require("dotenv").config({ path: "../../../.env" }); 5 | 6 | /** 7 | * @type import('hardhat/config').HardhatUserConfig 8 | */ 9 | module.exports = { 10 | solidity: "0.8.19", 11 | defaultNetwork: "hardhat", 12 | networks: { 13 | hardhat: {}, 14 | sepolia: { 15 | url: "https://rpc-sepolia-eth.nodeguardians.io", 16 | accounts: [process.env.PRIVATE_KEY], 17 | }, 18 | }, 19 | paths: { 20 | sources: "./contracts_", 21 | }, 22 | }; 23 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/static-call-detection/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomiclabs/hardhat-ethers"); 2 | require("@nomicfoundation/hardhat-chai-matchers"); 3 | 4 | require("dotenv").config({ path: "../../../.env" }); 5 | 6 | /** 7 | * @type import('hardhat/config').HardhatUserConfig 8 | */ 9 | module.exports = { 10 | solidity: "0.8.19", 11 | defaultNetwork: "hardhat", 12 | networks: { 13 | hardhat: {}, 14 | sepolia: { 15 | url: "https://rpc-sepolia-eth.nodeguardians.io", 16 | accounts: [process.env.PRIVATE_KEY], 17 | }, 18 | }, 19 | paths: { 20 | sources: "./contracts_", 21 | }, 22 | }; -------------------------------------------------------------------------------- /campaigns/token-standards/building-erc-20/test/foundry/DoubloonEvents.4.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.20; 3 | 4 | import "./testsuites/TestDoubloonEvents.sol"; 5 | 6 | contract PublicTest1 is TestDoubloonEvents { 7 | string DATA_PATH = "test/data/doubloonTransfer.json"; 8 | string DATA_KEY = "[0]"; 9 | constructor() TestDoubloonEvents(DATA_PATH, DATA_KEY) { } 10 | } 11 | 12 | contract PublicTest2 is TestDoubloonEvents { 13 | string DATA_PATH = "test/data/doubloonTransfer.json"; 14 | string DATA_KEY = "[1]"; 15 | constructor() TestDoubloonEvents(DATA_PATH, DATA_KEY) { } 16 | } -------------------------------------------------------------------------------- /campaigns/understanding-storage/storage-layout/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomiclabs/hardhat-ethers"); 2 | require("@nomicfoundation/hardhat-chai-matchers"); 3 | 4 | require("dotenv").config({ path: "../../../.env" }); 5 | 6 | /** 7 | * @type import('hardhat/config').HardhatUserConfig 8 | */ 9 | module.exports = { 10 | solidity: "0.8.19", 11 | defaultNetwork: "hardhat", 12 | networks: { 13 | hardhat: {}, 14 | sepolia: { 15 | url: "https://rpc-sepolia-eth.nodeguardians.io", 16 | accounts: [process.env.PRIVATE_KEY], 17 | }, 18 | }, 19 | paths: { 20 | sources: "./contracts_", 21 | }, 22 | }; 23 | -------------------------------------------------------------------------------- /campaigns/diamonds/building-diamonds/contracts/facets/OwnershipFacet.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | import { LibDiamond } from "../libraries/LibDiamond.sol"; 5 | import { IERC173 } from "../interfaces/IERC173.sol"; 6 | 7 | contract OwnershipFacet is IERC173 { 8 | function transferOwnership(address _newOwner) external override { 9 | LibDiamond.enforceIsContractOwner(); 10 | LibDiamond.setContractOwner(_newOwner); 11 | } 12 | 13 | function owner() external override view returns (address owner_) { 14 | owner_ = LibDiamond.contractOwner(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /campaigns/gas-golfing-s1/internal-representation/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "internal-representation", 3 | "version": "1.0.0", 4 | "scripts": { 5 | "test": "hardhat test --network hardhat && forge test", 6 | "test:hardhat": "hardhat test --network hardhat", 7 | "metrics": "hardhat run tasks/getMetrics.js" 8 | }, 9 | "author": "", 10 | "license": "MIT", 11 | "dependencies": { 12 | "@node-guardians/ng-quests-helpers": "^1.0.4", 13 | "@nomicfoundation/hardhat-toolbox": "^5.0.0", 14 | "@solidity-parser/parser": "^0.16.0", 15 | "chai-exclude": "^2.1.0", 16 | "hardhat": "^2.13.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /campaigns/gas-optimization/assembly-optimization/contracts/Challenge.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | pragma solidity ^0.8.19; 3 | 4 | abstract contract Challenge { 5 | 6 | /** 7 | * @notice Returns a copy of the given array in a gas efficient way. 8 | * @dev This contract will be called internally. 9 | * @param array The array to copy. 10 | * @return copy The copied array. 11 | */ 12 | function copyArray(bytes memory array) 13 | internal 14 | pure 15 | returns (bytes memory copy) 16 | { 17 | 18 | // IMPLEMENT THIS FUNCTION 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /campaigns/learning-assembly/calldata-manipulation/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "calldata-manipulation", 3 | "version": "2.0.0", 4 | "scripts": { 5 | "test": "hardhat test --network hardhat && forge test", 6 | "test:hardhat": "hardhat test --network hardhat" 7 | }, 8 | "author": "", 9 | "license": "MIT", 10 | "dependencies": { 11 | "@node-guardians/ng-quests-helpers": "^1.0.0", 12 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", 13 | "@nomiclabs/hardhat-ethers": "^2.2.2", 14 | "@solidity-parser/parser": "^0.16.0", 15 | "chai-exclude": "^2.1.0", 16 | "hardhat": "^2.13.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /campaigns/playing-with-op-stack/create-op-rollup/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomiclabs/hardhat-ethers"); 2 | require("@nomicfoundation/hardhat-chai-matchers"); 3 | 4 | require("dotenv").config({ path: "../../../.env" }); 5 | 6 | /** 7 | * @type import('hardhat/config').HardhatUserConfig 8 | */ 9 | module.exports = { 10 | solidity: "0.8.19", 11 | defaultNetwork: "hardhat", 12 | networks: { 13 | hardhat: {}, 14 | sepolia: { 15 | url: "https://rpc-sepolia-eth.nodeguardians.io", 16 | accounts: [process.env.PRIVATE_KEY], 17 | }, 18 | }, 19 | paths: { 20 | sources: "./contracts_", 21 | }, 22 | }; 23 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/bypassing-extcodesize/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomiclabs/hardhat-ethers"); 2 | require("@nomicfoundation/hardhat-chai-matchers"); 3 | 4 | require("dotenv").config({ path: "../../../.env" }); 5 | 6 | /** 7 | * @type import('hardhat/config').HardhatUserConfig 8 | */ 9 | module.exports = { 10 | solidity: "0.8.19", 11 | defaultNetwork: "hardhat", 12 | networks: { 13 | hardhat: {}, 14 | sepolia: { 15 | url: "https://rpc-sepolia-eth.nodeguardians.io", 16 | accounts: [process.env.PRIVATE_KEY], 17 | }, 18 | }, 19 | paths: { 20 | sources: "./contracts_", 21 | }, 22 | }; 23 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/emergency-governance/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomiclabs/hardhat-ethers"); 2 | require("@nomicfoundation/hardhat-chai-matchers"); 3 | 4 | require("dotenv").config({ path: "../../../.env" }); 5 | 6 | /** 7 | * @type import('hardhat/config').HardhatUserConfig 8 | */ 9 | module.exports = { 10 | solidity: "0.8.19", 11 | defaultNetwork: "hardhat", 12 | networks: { 13 | hardhat: {}, 14 | sepolia: { 15 | url: "https://rpc-sepolia-eth.nodeguardians.io", 16 | accounts: [process.env.PRIVATE_KEY], 17 | }, 18 | }, 19 | paths: { 20 | sources: "./contracts_", 21 | }, 22 | }; 23 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/price-oracle-attack/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomiclabs/hardhat-ethers"); 2 | require("@nomicfoundation/hardhat-chai-matchers"); 3 | 4 | require("dotenv").config({ path: "../../../.env" }); 5 | 6 | /** 7 | * @type import('hardhat/config').HardhatUserConfig 8 | */ 9 | module.exports = { 10 | solidity: "0.8.19", 11 | defaultNetwork: "hardhat", 12 | networks: { 13 | hardhat: {}, 14 | sepolia: { 15 | url: "https://rpc-sepolia-eth.nodeguardians.io", 16 | accounts: [process.env.PRIVATE_KEY], 17 | }, 18 | }, 19 | paths: { 20 | sources: "./contracts_", 21 | }, 22 | }; 23 | -------------------------------------------------------------------------------- /campaigns/token-standards/building-erc-20/test/foundry/DoubloonCreation.2.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.20; 3 | 4 | import "./testsuites/TestDoubloonCreation.sol"; 5 | 6 | contract PublicTest1 is TestDoubloonCreation { 7 | string DATA_PATH = "test/data/doubloonCreation.json"; 8 | string DATA_KEY = "[0]"; 9 | constructor() TestDoubloonCreation(DATA_PATH, DATA_KEY) { } 10 | } 11 | 12 | contract PublicTest2 is TestDoubloonCreation { 13 | string DATA_PATH = "test/data/doubloonCreation.json"; 14 | string DATA_KEY = "[1]"; 15 | constructor() TestDoubloonCreation(DATA_PATH, DATA_KEY) { } 16 | } -------------------------------------------------------------------------------- /campaigns/token-standards/building-erc-20/test/foundry/DoubloonTransfer.3.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.20; 3 | 4 | import "./testsuites/TestDoubloonTransfer.sol"; 5 | 6 | contract PublicTest1 is TestDoubloonTransfer { 7 | string DATA_PATH = "test/data/doubloonTransfer.json"; 8 | string DATA_KEY = "[0]"; 9 | constructor() TestDoubloonTransfer(DATA_PATH, DATA_KEY) { } 10 | } 11 | 12 | contract PublicTest2 is TestDoubloonTransfer { 13 | string DATA_PATH = "test/data/doubloonTransfer.json"; 14 | string DATA_KEY = "[1]"; 15 | constructor() TestDoubloonTransfer(DATA_PATH, DATA_KEY) { } 16 | } -------------------------------------------------------------------------------- /campaigns/token-standards/building-erc-20/test/foundry/MintableDoubloon.5.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.20; 3 | 4 | import "./testsuites/TestMintableDoubloon.sol"; 5 | 6 | contract PublicTest1 is TestMintableDoubloon { 7 | string DATA_PATH = "test/data/mintableDoubloon.json"; 8 | string DATA_KEY = "[0]"; 9 | constructor() TestMintableDoubloon(DATA_PATH, DATA_KEY) { } 10 | } 11 | 12 | contract PublicTest2 is TestMintableDoubloon { 13 | string DATA_PATH = "test/data/mintableDoubloon.json"; 14 | string DATA_KEY = "[1]"; 15 | constructor() TestMintableDoubloon(DATA_PATH, DATA_KEY) { } 16 | } -------------------------------------------------------------------------------- /campaigns/gas-optimization/assembly-optimization/test/hardhat/Challenge.test.js: -------------------------------------------------------------------------------- 1 | const { testCopyArray } = require("./testsuites/testChallenge.js"); 2 | const GasReporter = require("./gasReporter.js"); 3 | const inputs = require("../data/arrays.json"); 4 | 5 | describe("Challenge (Part 1)", function() { 6 | 7 | const gasConsumed = []; 8 | 9 | testCopyArray("Public Test 1", inputs[0], gasConsumed); 10 | testCopyArray("Public Test 2", inputs[1], gasConsumed); 11 | testCopyArray("Public Test 3", inputs[2], gasConsumed); 12 | 13 | after(function () { 14 | GasReporter.logTable(gasConsumed, {padding: 4}); 15 | }); 16 | 17 | }); 18 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/flashloan-counterexploit/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "flashloan-counterexploit", 3 | "version": "1.1.0", 4 | "scripts": { 5 | "test": "hardhat compile && forge test --fork-url https://rpc-sepolia-eth.nodeguardians.io", 6 | "deploy": "hardhat run ../../../scripts/deploy-validator.js --network sepolia" 7 | }, 8 | "author": "", 9 | "license": "MIT", 10 | "dependencies": { 11 | "@node-guardians/ng-quests-contracts": "^1.0.0", 12 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", 13 | "@nomiclabs/hardhat-ethers": "^2.2.2", 14 | "dotenv": "^16.0.3", 15 | "hardhat": "^2.13.0" 16 | } 17 | } -------------------------------------------------------------------------------- /campaigns/standalone-quests/self-hosted-evm/contracts/test/helpers/Create2.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.16; 3 | 4 | contract Create2 { 5 | // solc-ignore-next-line unused-param 6 | function create2( 7 | bytes memory cdata, 8 | uint256 salt 9 | ) public payable returns (address addr) { 10 | assembly { 11 | addr := create2(callvalue(), add(cdata, 0x20), mload(cdata), salt) 12 | 13 | if iszero(addr) { 14 | returndatacopy(0, 0, returndatasize()) 15 | revert(0, returndatasize()) 16 | } 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /campaigns/token-standards/building-erc-721/contracts/interfaces/IERC165.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.20; 4 | 5 | interface IERC165 { 6 | /// @dev Query if a contract implements an interface 7 | /// @param interfaceID The interface identifier, as specified in ERC-165 8 | /// @dev Interface identification is specified in ERC-165. This function 9 | /// uses less than 30,000 gas. 10 | /// @return `true` if the contract implements `interfaceID` and 11 | /// `interfaceID` is not 0xffffffff, `false` otherwise 12 | function supportsInterface(bytes4 interfaceID) external view returns (bool); 13 | } -------------------------------------------------------------------------------- /campaigns/proxy-contracts/basic-proxies/contracts/MechSuitV2.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | contract MechSuitV2 { 5 | 6 | // Space reserved for UpgradeableMechSuit to store delegate address 7 | bytes32 private DO_NOT_USE; 8 | 9 | uint32 public fuel; 10 | uint8 public ammunition; 11 | 12 | function blastCannon() external returns (bytes32) { 13 | ammunition -= 1; 14 | return keccak256("BOOM!"); 15 | } 16 | 17 | function refuel() external payable { 18 | require(msg.value == 1 gwei); 19 | fuel = 100; 20 | ammunition = 8; 21 | } 22 | 23 | 24 | } -------------------------------------------------------------------------------- /campaigns/gas-golfing-s1/changing-base/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "changing-base", 3 | "version": "1.0.0", 4 | "scripts": { 5 | "test": "hardhat test --network hardhat && forge test", 6 | "test:hardhat": "hardhat test --network hardhat", 7 | "metrics": "hardhat run tasks/getMetrics.js" 8 | }, 9 | "author": "", 10 | "license": "MIT", 11 | "dependencies": { 12 | "@node-guardians/ng-quests-helpers": "^1.0.4", 13 | "@nomicfoundation/hardhat-toolbox": "^5.0.0", 14 | "@solidity-parser/parser": "^0.16.0", 15 | "chai-exclude": "^2.1.0", 16 | "hardhat": "^2.13.0", 17 | "simple-base-converter": "^1.0.19" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /campaigns/gas-golfing-s1/roman-numerals/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "roman-numerals", 3 | "version": "1.0.0", 4 | "scripts": { 5 | "test": "hardhat test --network hardhat && forge test", 6 | "test:hardhat": "hardhat test --network hardhat", 7 | "metrics": "hardhat run tasks/getMetrics.js" 8 | }, 9 | "author": "", 10 | "license": "MIT", 11 | "dependencies": { 12 | "@node-guardians/ng-quests-helpers": "^1.0.4", 13 | "@nomicfoundation/hardhat-toolbox": "^5.0.0", 14 | "@solidity-parser/parser": "^0.16.0", 15 | "chai-exclude": "^2.1.0", 16 | "hardhat": "^2.13.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /campaigns/learning-assembly/calldata-manipulation/contracts/WhispersV1.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.19; 3 | 4 | contract WhispersV1 { 5 | 6 | /// @notice Read and return the uint256 appended behind the expected calldata. 7 | function whisperUint256() external pure returns (uint256 value) { 8 | assembly { 9 | } 10 | } 11 | 12 | /// @notice Read and return the string appended behind the expected calldata. 13 | /// @dev The string is abi-encoded. 14 | function whisperString() external pure returns (string memory str) { 15 | assembly { 16 | 17 | } 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/bypassing-extcodesize/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bypassing-extcodesize", 3 | "version": "1.1.1", 4 | "scripts": { 5 | "test": "hardhat test --network hardhat && forge build", 6 | "deploy": "hardhat run ../../../scripts/deploy-validator.js --network sepolia" 7 | }, 8 | "author": "", 9 | "license": "MIT", 10 | "dependencies": { 11 | "@node-guardians/ng-quests-contracts": "^1.0.0", 12 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", 13 | "@nomiclabs/hardhat-ethers": "^2.2.2", 14 | "dotenv": "^16.0.3", 15 | "hardhat": "^2.13.0" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /campaigns/gas-golfing-s1/remove-duplicates/test/hardhat/Challenge1.test.js: -------------------------------------------------------------------------------- 1 | const inputs = require("../data/inputs.json"); 2 | const { testChallenge, testMeasureChallenge } = require("./testsuites/testChallenge"); 3 | const { cheating } = require("@node-guardians/ng-quests-helpers"); 4 | 5 | describe("Challenge (Part 1)", function () { 6 | // Correctness tests 7 | for (let i = 0; i < inputs.length; i++) { 8 | testChallenge(`Public Test ${i + 1}`, inputs[i], false); 9 | } 10 | 11 | // Gas efficiency test 12 | testMeasureChallenge(inputs, 60000); 13 | 14 | // External code test 15 | cheating.testExternalCode("contracts/Challenge.sol"); 16 | }); 17 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/celestia-blobstream/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomiclabs/hardhat-ethers"); 2 | require("@nomicfoundation/hardhat-chai-matchers"); 3 | 4 | require('dotenv').config({ path: '../../../.env' }); 5 | 6 | /** 7 | * @type import('hardhat/config').HardhatUserConfig 8 | */ 9 | module.exports = { 10 | solidity: "0.8.19", 11 | defaultNetwork: "hardhat", 12 | networks: { 13 | hardhat: { 14 | }, 15 | sepolia: { 16 | url: "https://rpc-sepolia-eth.nodeguardians.io", 17 | accounts: [process.env.PRIVATE_KEY], 18 | }, 19 | }, 20 | paths: { 21 | sources: "./contracts_", 22 | }, 23 | }; -------------------------------------------------------------------------------- /campaigns/standalone-quests/finding-ouroboros/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomiclabs/hardhat-ethers"); 2 | require("@nomicfoundation/hardhat-chai-matchers"); 3 | 4 | require('dotenv').config({ path: '../../../.env' }); 5 | 6 | /** 7 | * @type import('hardhat/config').HardhatUserConfig 8 | */ 9 | module.exports = { 10 | solidity: "0.8.19", 11 | defaultNetwork: "hardhat", 12 | networks: { 13 | hardhat: { 14 | }, 15 | sepolia: { 16 | url: "https://rpc-sepolia-eth.nodeguardians.io", 17 | accounts: [process.env.PRIVATE_KEY], 18 | }, 19 | }, 20 | paths: { 21 | sources: "./contracts_", 22 | }, 23 | }; -------------------------------------------------------------------------------- /campaigns/standalone-quests/setting-up/test/hardhat/HelloGuardian.test.js: -------------------------------------------------------------------------------- 1 | const { ethers } = require("hardhat"); 2 | const { expect } = require("chai"); 3 | 4 | describe("HelloGuardian (Part 3)", function () { 5 | let HelloGuardian; 6 | let helloGuardian; 7 | 8 | before(async function () { 9 | HelloGuardian = await ethers.getContractFactory("HelloGuardian"); 10 | helloGuardian = await HelloGuardian.deploy(); 11 | 12 | await helloGuardian.deployed(); 13 | }); 14 | 15 | it("Should say hello", async function () { 16 | let result = await helloGuardian.hello(); 17 | expect(result).to.be.equals("Hello Guardian"); 18 | }); 19 | 20 | }); 21 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/interactive-fraud-proofs/hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomiclabs/hardhat-ethers"); 2 | require("@nomicfoundation/hardhat-chai-matchers"); 3 | 4 | require('dotenv').config({ path: '../../../.env' }); 5 | 6 | /** 7 | * @type import('hardhat/config').HardhatUserConfig 8 | */ 9 | module.exports = { 10 | solidity: "0.8.19", 11 | defaultNetwork: "hardhat", 12 | networks: { 13 | hardhat: { 14 | }, 15 | sepolia: { 16 | url: "https://rpc-sepolia-eth.nodeguardians.io", 17 | accounts: [process.env.PRIVATE_KEY], 18 | }, 19 | }, 20 | paths: { 21 | sources: "./contracts_", 22 | }, 23 | }; -------------------------------------------------------------------------------- /campaigns/standalone-quests/static-call-detection/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "static-call-detection", 3 | "version": "1.0.0", 4 | "scripts": { 5 | "test": "hardhat test --network hardhat && forge test", 6 | "test:hardhat": "hardhat test --network hardhat", 7 | "deploy": "hardhat run ../../../scripts/deploy-validator.js --network sepolia" 8 | }, 9 | "dependencies": { 10 | "@node-guardians/ng-quests-contracts": "^1.0.0", 11 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", 12 | "@nomiclabs/hardhat-ethers": "^2.2.2", 13 | "dotenv": "^16.0.3", 14 | "hardhat": "^2.13.0" 15 | }, 16 | "author": "", 17 | "license": "MIT" 18 | } 19 | -------------------------------------------------------------------------------- /campaigns/gas-golfing-s1/internal-representation/test/hardhat/Challenge.test.js: -------------------------------------------------------------------------------- 1 | const inputs = require("../data/inputs.json"); 2 | const { testChallenge, testMeasureChallenge } = require("./testsuites/testChallenge"); 3 | const { cheating } = require("@node-guardians/ng-quests-helpers"); 4 | 5 | describe("Challenge (Part 1)", function () { 6 | // Correctness tests 7 | for (let i = 0; i < inputs.length; i++) { 8 | testChallenge(`Public Test ${i + 1}`, inputs[i], false); 9 | } 10 | 11 | // Gas efficiency test 12 | testMeasureChallenge(inputs, 220000); 13 | 14 | // External code test 15 | cheating.testGolfingConstraints("contracts/Challenge.sol"); 16 | }); 17 | -------------------------------------------------------------------------------- /campaigns/gas-golfing-s1/roman-numerals/test/hardhat/Challenge.test.js: -------------------------------------------------------------------------------- 1 | const inputs = require("../data/inputs.json"); 2 | const { testChallenge, testMeasureChallenge } = require("./testsuites/testChallenge"); 3 | const { cheating } = require("@node-guardians/ng-quests-helpers"); 4 | 5 | describe("Challenge (Part 1)", function () { 6 | 7 | // Correctness tests 8 | for (let i = 0; i < inputs.length; i++) { 9 | testChallenge(`Public Test ${i + 1}`, inputs[i], false); 10 | } 11 | 12 | // Gas efficiency test 13 | testMeasureChallenge(inputs, 4800); 14 | 15 | // Constraints test 16 | cheating.testGolfingConstraints("contracts/Challenge.sol"); 17 | 18 | }); 19 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/setting-up/test/hardhat/Submission.test.js: -------------------------------------------------------------------------------- 1 | const { ethers } = require("hardhat"); 2 | const { expect } = require("chai"); 3 | 4 | describe("HelloGuardian (Part 4)", function () { 5 | let HelloGuardian; 6 | let helloGuardian; 7 | 8 | before(async function () { 9 | HelloGuardian = await ethers.getContractFactory("HelloGuardian"); 10 | helloGuardian = await HelloGuardian.deploy(); 11 | 12 | await helloGuardian.deployed(); 13 | }); 14 | 15 | it("Should be ready to submit", async function () { 16 | let result = await helloGuardian.hello(); 17 | expect(result).to.be.equals("Hello Guardian"); 18 | }); 19 | 20 | }); 21 | -------------------------------------------------------------------------------- /campaigns/standalone-quests/price-oracle-attack/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "price-oracle-attack", 3 | "version": "1.1.1", 4 | "scripts": { 5 | "test": "hardhat test --network hardhat && forge build", 6 | "deploy": "hardhat run scripts/deploy-validator.js --network sepolia" 7 | }, 8 | "author": "", 9 | "license": "MIT", 10 | "dependencies": { 11 | "@uniswap/v2-core": "^1.0.1", 12 | "@node-guardians/ng-quests-contracts": "^1.0.0", 13 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", 14 | "@nomiclabs/hardhat-ethers": "^2.2.2", 15 | "@openzeppelin/contracts": "^4.9.3", 16 | "dotenv": "^16.0.3", 17 | "hardhat": "^2.13.0" 18 | } 19 | } -------------------------------------------------------------------------------- /campaigns/standalone-quests/emergency-governance/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "emergency-governance", 3 | "version": "1.1.1", 4 | "scripts": { 5 | "test": "hardhat compile && forge test", 6 | "deploy": "hardhat run ../../../scripts/deploy-validator.js --network sepolia" 7 | }, 8 | "author": "", 9 | "license": "MIT", 10 | "dependencies": { 11 | "@node-guardians/ng-quests-contracts": "^1.0.0", 12 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.6", 13 | "@nomiclabs/hardhat-ethers": "^2.2.2", 14 | "@openzeppelin/contracts": "^4.9.3", 15 | "dotenv": "^16.0.3", 16 | "hardhat": "^2.13.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /campaigns/token-standards/building-erc-721/test/foundry/AmuletTransfer.3.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.20; 3 | 4 | import "./testsuites/TestAmuletTransfer.sol"; 5 | 6 | contract PublicTest1 is TestAmuletTransfer { 7 | string DATA_PATH = "test/data/amuletTransfer.json"; 8 | string DATA_KEY = "[0]"; 9 | constructor() TestAmuletTransfer(DATA_PATH, DATA_KEY) { } 10 | } 11 | 12 | contract PublicTest2 is TestAmuletSafeTransfer { 13 | string DATA_PATH = "test/data/amuletTransfer.json"; 14 | string DATA_KEY = "[0]"; 15 | constructor() TestAmuletSafeTransfer(DATA_PATH, DATA_KEY) { } 16 | } 17 | 18 | contract PrivateTest2 is TestAmuletEvents { } --------------------------------------------------------------------------------