This repository contains the smart contracts for SimplePage, built using the Foundry development framework.
- Foundry
- Make
- Install dependencies:
forge install- Build the contracts:
make buildThe following commands are available through the Makefile:
Run the test suite:
make testFormat the Solidity code:
make formatGenerate gas snapshots:
make snapshotDeploy to local network (requires running Anvil):
make deploy-dev <beneficiary_address> <price_feed_address>Deploy to Sepolia testnet:
make deploy-sepolia <beneficiary_address> <price_feed_address>Where
beneficiary_addressis the address that recieves subscription feesprice_feed_addressis chainlink ETH/USD price feed (0x694AA1769357215DE4FAC081bf1f309aDC325306)private_keyis the private key used for deployment
Deploy to Ethereum mainnet:
make deploy <beneficiary_address> <price_feed_address>Where
beneficiary_addressis the address that recieves subscription feesprice_feed_addressis chainlink ETH/USD price feed ()private_keyis the private key used for deployment
If SimplePage is already deployed and you only want to ship a new renderer version, deploy the renderer contract separately and then point SimplePage at it.
- Build the contracts:
make build- Deploy the new renderer, passing the existing
SimplePageaddress to the constructor:
forge create src/TokenRendererV3.sol:TokenRendererV3 \
--rpc-url <your_rpc_url> \
--account simplepage-deploy \
--broadcast \
--verify \
--constructor-args <simple_page_address>Replace src/TokenRendererV3.sol:TokenRendererV3 with your renderer contract path and name if you are deploying a different version.
-
Update the live
SimplePagecontract to use the new renderer. If on mainnet, do it using the simplepage multisig. -
Confirm the renderer was updated:
cast call <simple_page_address> "renderer()(address)" --rpc-url <your_rpc_url>After deployment, verify your contracts on Etherscan:
forge verify-contract <deployed_address> <contract_name> --chain <chain_id> --api-key <etherscan_api_key> --watchRemove build artifacts:
make cleanFor a full list of available commands:
make helpFor more detailed information about Foundry: