Launching on Sophon
Early partners program
As with any blockchain, you need the native token ($SOPH in our case) to interact with Sophon. However, during the alpha stage, we won't distribute tokens for either Testnet or Mainnet. Instead, you'll interact with our Paymaster, which will sponsor your deployment transactions and interactions with your deployed contracts.
This approach eliminates the need for $SOPH tokens for both you and your users during the alpha stage.
To join the allow list, please complete this form. We'll contact you once you've been added to the Paymaster's allow list.
Deploying on Sophon
Hardhat config
We recommend to scaffold your project using the zksync-cli (documentation).
Here's the network configuration you should add to your setup:
Contract deployment
To deploy a contract without SOPH tokens you need to slightly change your deployment code to use our Paymaster (after we add your deployment wallet to the allow list, which was requested when you filled the form).
Before
After
Using zksync-ethers v5
Using zksync-ethers v6
Proxy deployment
To deploy proxy contracts using the paymaster, you must use a beta version of hardhat-zksync-upgradable
library. Know more about it in this docs.
Version for ethers-v5 version - https://www.npmjs.com/package/@matterlabs/hardhat-zksync-upgradable/v/0.6.0-beta.2
Version for ethers-v6 -https://www.npmjs.com/package/@matterlabs/hardhat-zksync-upgradable/v/1.6.0-beta.3)))
Deployed contracts interaction through our Paymaster
Our infrastructure will listen for your deployments, and add your contract address to our paymaster. This will allow the Paymaster to also sponsor any transactions sent to your contracts. This might take a few minutes. If you don't see you contract address added after 10 minutes, please reach out to us.
Checking your contract address was added
Navigate to the Restrictions contract → https://explorer.testnet.sophon.xyz/address/0xa2d710e74CDf511BFB37A5a553A6D4A1850cf3CF#contract
Click on the “Contract” tabs, and then on “Read”
Select the contractWhitelist function, and add your contract address in the input field.
Perform the query
<aside> ❗
Calling a contract just after deployment will cause the error Validation revert: Paymaster validation error: Paymaster is not useable for this transaction
as the Sophon infrastructure takes around 30 seconds to whitelist new contracts. Adding a delay will solve the issue
</aside>
Allowing your users to interact with your product using the Paymaster
Now you can get your product to use the Paymaster for all its transactions. Again, you just need to do a minor change to the code sending the transactions.
Before
After
Last updated