Contracts
The REFER Protocol consists of two primary contracts: the Referral Factory and the Referral Contract.
Currently deployed on Base (an Ethereum L2 based on the OP Stack), we are open to expanding referral graphs to other EVM chains and even making the protocol multichain with cross-chain signatures.
REPO: https://github.com/potlock/refer-protocol/tree/main/contracts
Deployed Contracts
- Mainnet: TBD
- Staging: TBD
- Testnet: TBD
Source Code: [Link to be added when available]
If you're interested in having us deploy contracts on your chain, please contact the Potlock Foundation.
How to Deploy Contracts on EVM
Introduction to Solidity
Solidity is the primary programming language for writing smart contracts on Ethereum and EVM-compatible blockchains. Here's a brief introduction:
- Solidity is a statically-typed, contract-oriented language
- Its syntax is similar to JavaScript, but with some key differences
- Key features include contract definitions, functions, state variables, and events
- The Solidity compiler (solc) compiles code into EVM bytecode
- Smart contracts written in Solidity can handle transactions, store data, and execute complex logic
Learn more: Solidity Documentation
Introduction to EVM
The Ethereum Virtual Machine (EVM) is the runtime environment for smart contracts on Ethereum and EVM-compatible chains:
- EVM is a stack-based, 256-bit virtual machine
- It executes bytecode compiled from high-level languages like Solidity
- EVM ensures deterministic execution across all nodes in the network
- Key concepts: gas (execution cost), storage, memory, and calldata
- EVM opcodes define the low-level instructions that can be executed
Learn more: Ethereum Yellow Paper
How to Deploy Contracts on Base
Base is an Ethereum L2 scaling solution built on the OP Stack. To deploy contracts on Base:
- Set up a development environment (e.g., Hardhat, Truffle)
- Write and test your smart contracts locally
- Configure your deployment script for the Base network
- Obtain Base testnet or mainnet tokens for gas fees
- Deploy using your chosen development framework
Base Network Details:
- Base Mainnet: Base Mainnet RPC details
- Base Goerli Testnet: Base Goerli Testnet RPC details
Learn more:
- About Base: https://base.org/
- Base Documentation: https://docs.base.org/
Get Testnet Tokens on BASE
To get testnet tokens on Base Goerli:
- Set up a wallet compatible with Base (e.g., MetaMask)
- Add Base Goerli network to your wallet
- Visit the Base Goerli Faucet: https://docs.base.org/tools/network-faucets
- Connect your wallet and request testnet tokens
- Use these tokens for deploying and interacting with contracts on the testnet
Useful Tools
- Gas Fee Estimator: https://gasfees.io
- L2 Fee Comparison: https://l2fees.info/