This material is copyrighted by RareSkills. External distribution is prohibited.

Section 0: Before you begin

Randomness Oracle

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.

Price Oracle

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
	}
}

Section 1: Study

Read this

https://blog.chain.link/chainlink-price-feeds-secure-defi/

Section 2a: Practice

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.