c597216905 | ||
---|---|---|
.github | ||
.vscode | ||
contracts | ||
lib | ||
script | ||
scripts | ||
test | ||
.editorconfig | ||
.env.example | ||
.gas-snapshot | ||
.gitattributes | ||
.gitignore | ||
.gitmodules | ||
.prettierignore | ||
.prettierrc.yml | ||
.solhint.json | ||
PROPERTIES.md | ||
README.md | ||
codecov.yml | ||
contracts.json | ||
foundry.toml | ||
index.js | ||
package.json | ||
pnpm-lock.yaml | ||
remappings.txt | ||
slither.config.json |
README.md
Bridging SNT with the Optimism SDK
This repository contains code to deploy SNT in Ethereum and bridge it to optimism.
Deployments
Contract | Address | Snapshot |
---|---|---|
Optimism Mainnet | ||
OptimismMintableMiniMeToken | 0x650AF3C15AF43dcB218406d30784416D64Cfb6B2 |
1b3159a |
SNTOptimismController | 0x76352764590378011CAE677b50110Ae02eDE2b62 |
1b3159a |
Scripts:
$ MNEMONIC=$YOUR_MNEMONIC forge script script/DeployBridge.s.sol --fork-url $YOUR_RPC_URL --broadcast
Where
$YOUR_MNEMONIC
is the mnemonic that contains the account from which you want to deploy. The deploy script will use the first account derived from the mnemonic by default.$YOUR_RPC_URL
is the RPC endpoint of the node you're connecting to.
You can omit the --broadcast
option to simulate the deployment before actually performing it.
All tokens, even on Optimism, are MiniMeToken variant, meaning they save all account's balance change on Ethereum state for democracy contract ballots. Learn more about MiniMeToken on the official repository vacpp2p/minime.
Differences from regular MiniMeToken
The MiniMeToken used in this repository is a fork of the original. To learn about the differences between the fork and the upstream repository, head over to its documentation.
- MiniMeToken uses generateTokens and destroyTokens operated by controller for mint and burn. OptimismMintableMiniMeToken uses mint and burn operated by bridge.
- MiniMeToken
version()
had to be renamed totoken_version()
due a conflict on inheritance and requirements of Optimism. Semver inheritance uses version() and this seems a requirement for Optimism.