Examples are made to demonstrate how zksync2-go SDK can be used for development. The examples demonstrate how to:
- Deposit ETH from Ethereum into zkSync.
- Transfer ETH on zkSync.
- Withdraw ETH from zkSync to Ethereum.
- Deploy a smart contract using create opcode.
- Deploy a smart contract with constructor using create method.
- Deploy a smart contract with dependency using create method.
- Deploy a smart contract using create2 opcode.
- Deploy a smart contract with constructor using create2 method.
- Deploy a smart contract with dependency using create2 method.
- Deposit token from Ethereum into zkSync.
- Transfer token on zkSync.
- Withdraw token from zkSync to Ethereum.
- Deploy custom token on zkSync.
- Deploy token using create method.
- Deploy token using create2 method.
- Deploy smart account using create method.
- Deploy smart account using create2 method.
- Use paymaster to pay fee with token.
Smart contract deployment use already generated binaries and go bindings. There is a user guide on how those artifacts are generated. Same approach can be used to generate required artifact for other smart contracts.
Run example:
PRIVATE_KEY=<...> go run 02_transfer.go