What is Base?
Base is an L2 on Ethereum that offers a secure, low-cost, developer-friendly way for anyone, anywhere, to build decentralized apps to bring the next billion users to web3. Base is Secured by Ethereum, Empowered by Coinbase and open source with Optimism.
To know more about Base L2 visit http://base.org
Deploy a Contract On Base
Here is a step-by-step guide on how to Deploy a Contract On Base.
Requirement:
Need a wallet, with ETH on Base Testnet. If you don’t have a test ETH follow this guide.
Step 1: Go to https://remix.ethereum.org/
Step 2: Go to Workspace from the left-panel menu and choose the Create New File icon and name it as “cryptomarketblog.sol” (Give any name with .sol extension).
Step 3: Copy & Paste the below code in cryptomarketblog.sol
pragma solidity 0.8.17;
// SPDX-License-Identifier: MIT
contract CryptoMarketBlog {
string public name = "Crypto Market Blog";
string public symbol = "CMB";
uint8 public decimals = 18;
uint256 public totalSupply = 10000000;
mapping (address => uint256) public balances;
address public owner;
constructor() {
owner = msg.sender;
balances[owner] = totalSupply;
}
function transfer(address recipient, uint256 amount) public {
require(balances[msg.sender] >= amount, "Insufficient balance.");
balances[msg.sender] -= amount;
balances[recipient] += amount;
}
}
Step 4: Compilation
Go to the Solidity Compiler from the left-panel -> click on 'Compile cryptomarketblog.sol' -> If there is no error you'll see a green tick on solidity compiler button
Step 5: Deployment
I am deploying this on Base testnet, So we need some testnet ETH for Gas, If you don’t have test ETH on your MetaMask, follow this guide.
Go to the Deploy & Run Transactions sidebar from the left-panel -> Select environment as 'Injected Provider - MetaMask'then you will get a MetaMask pop-up -> Click on connect -> Click on Deploy -> confirm MetaMask transaction
That’s it, You have successfully completed Contract Deployment On Base.
Claim Early Builder NFT
To claim Early Builder NFT on Base, copy your smart contact address.
Visit https://quests.base.org/ & Connect MetaMask address
Click on ‘Start Quest’ -> Accept terms & click on ‘Continue’ -> fund your wallet if you don’t have gas -> continue -> Input ‘smart contract address’ that you created -> click ‘verify transaction’ -> continue -> click on ‘Mint NFT’ -> confirm MetaMask transaction.
That’s it.