Breadchain smart contracts power Breadchain's governance application.
To learn more check out the Breadchain wiki.
Join in on the conversation in our Discord.
If you have skills (both technical and non-technical) that you believe would benefit our mission, you can fill out this Google Form. Expect to hear from a member of our team shortly regarding any potential opportunities for collaboration.
Contributions to this repo are expected to adhere to the Biconomy Solidity Style Guide.
$ forge build
$ forge fmt
$ forge snapshot
$ forge test --fork-url "https://rpc.gnosis.gateway.fm" -vvvv
forge script script/deploy/DeployYieldDistributor.s.sol:DeployYieldDistributor --rpc-url "https://rpc.gnosis.gateway.fm" --broadcast --private-key <pk>
Before upgrading to a new version of our deployed contracts, it is necessary to run the upgrade safety validation check. This ensures that upgrading won't break existing functionality or corrupt the contract's state.
- Checkout the deployed implementation commit (usually the
dev
branch) - Determine the new version targeted by the upgrade; it should be strictly higher than the latest deployed version tag
- Flatten YieldDistributor and ButteredBread (this will output a single .sol file with all dependencies inlined for comparison by the upgrade script):
forge flatten src/YieldDistributor.sol > test/upgrades/<new_version>/YieldDistributor.sol
forge flatten src/ButteredBread.sol > test/upgrades/<new_version>/ButteredBread.sol
- Checkout the upgrade branch
- Update the version in the options object of the
script/upgrades/ValidateUpgrade.s.sol
script - Run
forge clean && forge build && forge script script/upgrades/ValidateUpgrade.s.sol
- If script is runs successfully, proceed, otherwise address errors produced by the script until no errors are produced.
- Amend the
data
variable inscript/upgrades/UpgradeYieldDistributor.s.sol
to match desired data - run
forge clean && forge build && forge script script/upgrades/UpgradeYieldDistributor.s.sol --sig "run(address)" <proxy_address> --rpc-url $RPC_URL --sender <proxy_admin>
The proxy admin address is configured to be the Breadchain multisig at address 0x918dEf5d593F46735f74F9E2B280Fe51AF3A99ad
and the Yield Distributor proxy address is 0xeE95A62b749d8a2520E0128D9b3aCa241269024b