Smart contracts that enable and enhance the web3 social experience.
See the instructions below to run the code on localhost and for blockchain deployment.
Create a .env
file with the following keys:
DEPLOYER_PRIVATE_KEY=enter-key-here
npx hardhat compile
npx hardhat test
Run tests in a specific folder:
npx hardhat test test/*test.js
Run a specific test:
npx hardhat test test/some.test.js
Start a localhost node:
npx hardhat node
Make sure to add one of the private keys presented as deployer key in .env
file.
In a separate terminal tab then run the following command:
npx hardhat run scripts/deploy.js --network localhost
npx hardhat run scripts/deploy.js --network <network-name>
Also make sure you have the
@nomiclabs/hardhat-etherscan
library3.1.0
or above.
Verifying TLD contracts generated through the factory is a bit tricky, but there is a way around the issue. See scripts/temp/deployTld.js
for instructions.
Most audit tools will require you to flatten the contracts. This means that all contracts that are defined under the imports will actually be imported into one .sol file, so all code is in one place.
First create a new folder called flattened:
mkdir flattened
To flatten a contract, run this command:
npx hardhat flatten <path-to-contract> >> flattened/<flat-contract-name>.sol
You may also need to give all contracts in the flattened file the same Solidity version. And you may need to delete all SPDX lines except the very first one.
myth -v4 analyze flattened/PunkForbiddenTlds.sol
Flags:
v4
: verboseo
: outputa
: address onchainl
: automatically retrieve dependenciesmax-depth
: maximum recursion depth
Docs: https://mythril-classic.readthedocs.io/en/master/security-analysis.html
Install Slither:
pip3 install slither-analyzer --user
Run it in the flattened
folder:
slither .
Docs: https://github.com/crytic/slither
Run npx hardhat clean
and then npx hardhat compile
.
- Development preview: https://iggy-social-frontend.vercel.app/
- Landing page: https://iggy.social