🌊
Wave Contract
Waves are the main contracts of Tide, each one representing a campaign launched by a project. You can find the full code for Wave contracts in our public contracts repo.
Waves are ERC-721 compliant, meaning that the badges issued to users are NFTs that can be viewed and transferred on any NFT marketplace. The ownership of the contract is set to the deployer, so the project can have advanced on-chain customization with their campaign.
Waves are also ERC-2771 compliant, meaning they support transactions relayers. This allows projects to sponsor their users' gas fees by having the transaction been sent by our forwarder, which leverages Openzeppelin Defender to provide the best gasless experience for claiming rewards.
Waves implement a signature verification to restrict the access to the
claim()
function only to addresses that satisfy the correct requirements. When a user tries to claim with Tide frontend, our verifier runs the checks required by the campaign on its wallet and, if all of them are satisfied, signs a message with the claim info and returns it to the user.
The user can then use this signed message as a receipt to claim its badge by calling the claim() function on our contract: when called, the function checks the validity on the signature and mints the NFT to the user.

Having this setup for minting, allows Tide to manage access by integrating off-chain events (e.g., Twitter or Discord interactions) or off-chain listeners (e.g., TheGraph) while giving users full ownership of their credentials.
It also allows projects to have a suite of composable requirements to grant access to the campaigns, while keeping a gas-efficient smart contract.
Last modified 3mo ago