It's recommended that you've gone through the apeworx getting started documentation before proceeding here.
- git
- You'll know you did it right if you can run
git --version
and you see a response likegit version x.x.x
- You'll know you did it right if you can run
- Python
- You'll know you've installed python right if you can run:
python --version
orpython3 --version
and get an ouput like:Python x.x.x
- You'll know you've installed python right if you can run:
- pip
- You'll know you did it right if you can run
pip --version
orpip3 --version
and get an output likepip x.x from /some/path/here (python x.x)
- You'll know you did it right if you can run
- poetry
- You'll know you did it right if you can run
poetry --version
and get an output likePoetry version (x.x.x)
- You'll know you did it right if you can run
- Clone the repo
git clone https://github.com/patrickalphac/ape-fund-me-v23
cd ape-fund-me-v23
- Install dependencies
poetry install
poetry run ape plugins install alchemy vyper ape-etherscan
- Run unit tests
poetry run pytest
- Import an account
To import an account into ape, run the following:
poetry run ape accounts import default
Where default
will be the name of your account. Ape will then prompt you for your private key and password, and encrypt it on your computer. The only way to use this key moving forward will be to decrypt the key with your password.
See this faucet for testnet tokens.
- Set your RPC_URL
Since we are working with Alchemy, create an environment variables called WEB3_ALCHEMY_PROJECT_ID
or WEB3_ALCHEMY_API_KEY
. If using a linux or mac environment, you can set it by running:
export WEB3_ALCHEMY_PROJECT_ID=MY_API_TOKEN
- Run your script!
poetry run ape run scripts/deploy_fund_me.py --network ethereum:sepolia:alchemy
🛑 WARNING 🛑 Run staging tests sparingly! We didn't write them for this project
- Add your wallet password as an environment variable
export WALLET_PASSWORD=xxxx
(or place into your .env
)
To run staging tests, after running the above run:
poetry run ape test -m "staging" --network ethereum:sepolia:alchemy
This will test your contracts on a testnet.
poetry run black ./contracts/*.vy
poetry run vyper -f layout contracts/example_contracts/FunWithStorage.vy > fun_with_storage_layout.json
Verification is currently pretty wonky for vyper. Right now to verify a contract:
- Manually flatten the contract
- Deploy the contract
- This means, you'll have to convert all your interface imports to in-line imports
- Verify on the etherscan UI
- You'll need to be familiar with constructor abi-encoding
cast abi-encode "__init__(address)" 0x694AA1769357215DE4FAC081bf1f309aDC325306
Then remove the 0x
prefix.