This material is copyrighted by RareSkills. External distribution is prohibited.
Let’s start by writing code that integrates with other on chain smart contracts, specifically the chainlink VRF.
Build a contract, and deploy to any of the supported networks here: https://docs.chain.link/vrf/v2/subscription/supported-networks
Your code should mint someone an ERC721 with id from 0 to 100 based on the outcome of the VRF. Put some thought into how you will handle a number already being minted.
Complete this code
contract WrapPriceOracle {
function getPriceOfEtherInUSD() public view returns (uint256) {
// your code here. Connect to the chainlink pricefeed and
// get the answer.
}
function shouldIWorkAtMcDonalds() public view returns (bool) {
// price is less than 2k
}
}
https://blog.chain.link/chainlink-price-feeds-secure-defi/
Start this after you’ve completed Day 3: Chainlink Decentralized Approach. Don’t wait until you finish the readings to begin this.
Do not answer these questions conceptually. You need to link to the line number of the contract on etherscan. Use mainnet Ethereum.
roundId
and phaseId
?