Udacity Blockchain Capstone

The capstone will build upon the knowledge you have gained in the course in order to build a decentralized housing product.

Navigate to eth-contracts

install all dependencies

npm install

compile the contracts

truffle compile

Migrate to rinkeby test network

truffle migrate --network rinkeby --reset

Deployment

Mounikas-MacBook-Air:eth-contracts mounikabachu$ truffle migrate --network rinkeby --reset

Compiling your contracts...

Everything is up to date, there is nothing to compile.

Migrations dry-run (simulation)

Network name: 'rinkeby-fork' Network id: 4 Block gas limit: 29941438 (0x1c8debe)

1_initial_migration.js

Replacing 'Migrations'

block number: 9090278 block timestamp: 1628594421 account: 0x3C98cAC049c0E65f6dcF418017907251b96E6341 balance: 0.71910001 gas used: 210237 (0x3353d) gas price: 21 gwei value sent: 0 ETH total cost: 0.004414977 ETH


Total cost: 0.004414977 ETH

2_deploy_contracts.js

Deploying 'RithvikToken'

block number: 9090280 block timestamp: 1628594443 account: 0x3C98cAC049c0E65f6dcF418017907251b96E6341 balance: 0.663212353 gas used: 2633954 (0x2830e2) gas price: 21 gwei value sent: 0 ETH total cost: 0.055313034 ETH

Deploying 'Verifier'

block number: 9090281 block timestamp: 1628594449 account: 0x3C98cAC049c0E65f6dcF418017907251b96E6341 balance: 0.64288807 gas used: 967823 (0xec48f) gas price: 21 gwei value sent: 0 ETH total cost: 0.020324283 ETH

Deploying 'SolnSquareVerifier'

block number: 9090282 block timestamp: 1628594463 account: 0x3C98cAC049c0E65f6dcF418017907251b96E6341 balance: 0.577810582 gas used: 3098928 (0x2f4930) gas price: 21 gwei value sent: 0 ETH total cost: 0.065077488 ETH


Total cost: 0.140714805 ETH

Summary

Total deployments: 4 Final cost: 0.145129782 ETH

Starting migrations...

Network name: 'rinkeby' Network id: 4 Block gas limit: 29970705 (0x1c95111)

1_initial_migration.js

Replacing 'Migrations'

transaction hash: 0x270e90034d1cfbb6c05d6efd931da4b78d65e11fdfd79d3fe81aee5dfb08aa07 Blocks: 0 Seconds: 12 contract address: 0xe766337F5082F7cF8C7f6aA716748A4919dA36A7 block number: 9090282 block timestamp: 1628594497 account: 0x3C98cAC049c0E65f6dcF418017907251b96E6341 balance: 0.71875771 gas used: 226537 (0x374e9) gas price: 21 gwei value sent: 0 ETH total cost: 0.004757277 ETH

Saving migration to chain. Saving artifacts


Total cost: 0.004757277 ETH

2_deploy_contracts.js

Deploying 'RithvikToken'

transaction hash: 0x557df30a3a37ebd80f0b09fb81da2e460abbc25333d750e9926fb716e4ea7d95 Blocks: 0 Seconds: 4 contract address: 0xf793447894b241E8E75aE2D03f6b991207331e35 block number: 9090284 block timestamp: 1628594527 account: 0x3C98cAC049c0E65f6dcF418017907251b96E6341 balance: 0.659056453 gas used: 2797154 (0x2aae62) gas price: 21 gwei value sent: 0 ETH total cost: 0.058740234 ETH

Deploying 'Verifier'

transaction hash: 0x3a3bd19a24cccb7fc2ee4d32bf7a9203b3c39d0a8c021a5037e8cbcc4d74ae78 Blocks: 1 Seconds: 16 contract address: 0x40fF6872c8EFaB4d3F3CBfa1D1091c6B4BE1fda9 block number: 9090285 block timestamp: 1628594542 account: 0x3C98cAC049c0E65f6dcF418017907251b96E6341 balance: 0.63873217 gas used: 967823 (0xec48f) gas price: 21 gwei value sent: 0 ETH total cost: 0.020324283 ETH

Deploying 'SolnSquareVerifier'

transaction hash: 0x68e851b6c7299f407df5c55dfb87629d65fb98e026899b41d6287d0d43c6830c Blocks: 0 Seconds: 8 contract address: 0x5B86ca0d90f160391d08f3628b475DF98884A3Df block number: 9090287 block timestamp: 1628594572 account: 0x3C98cAC049c0E65f6dcF418017907251b96E6341 balance: 0.569526082 gas used: 3295528 (0x324928) gas price: 21 gwei value sent: 0 ETH total cost: 0.069206088 ETH

Saving migration to chain. Saving artifacts


Total cost: 0.148270605 ETH

Summary

Total deployments: 4 Final cost: 0.153027882 ETH

Rinkeby OpenSea url

https://testnets.opensea.io/assets/rithviktoken

Contract address for RithvikToken on Rinkeby

0xe8DCC77c73D52b16488fb95D5aD5C57E122cA45c

Contract ABI - RithvikToken

[ { "inputs": [ { "internalType": "string", "name": "name", "type": "string" }, { "internalType": "string", "name": "symbol", "type": "string" } ], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "approved", "type": "address" }, { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "Approval", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "operator", "type": "address" }, { "indexed": false, "internalType": "bool", "name": "approved", "type": "bool" } ], "name": "ApprovalForAll", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "owner", "type": "address" } ], "name": "Paused", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "to", "type": "address" }, { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "Transfer", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "owner", "type": "address" } ], "name": "Unpaused", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "changeOwner", "type": "event" }, { "constant": false, "inputs": [ { "internalType": "bytes32", "name": "_myid", "type": "bytes32" }, { "internalType": "string", "name": "_result", "type": "string" } ], "name": "__callback", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "bytes32", "name": "_myid", "type": "bytes32" }, { "internalType": "string", "name": "_result", "type": "string" }, { "internalType": "bytes", "name": "_proof", "type": "bytes" } ], "name": "__callback", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "approve", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "address", "name": "owner", "type": "address" } ], "name": "balanceOf", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "baseTokenURI", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "getApproved", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "getOwner", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "address", "name": "operator", "type": "address" } ], "name": "isApprovedForAll", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "name", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "ownerOf", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [], "name": "pauseContract", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "safeTransferFrom", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" }, { "internalType": "bytes", "name": "_data", "type": "bytes" } ], "name": "safeTransferFrom", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "bool", "name": "approved", "type": "bool" } ], "name": "setApprovalForAll", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "setTokenURI", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" } ], "name": "supportsInterface", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "symbol", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "uint256", "name": "index", "type": "uint256" } ], "name": "tokenByIndex", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "address", "name": "owner", "type": "address" }, { "internalType": "uint256", "name": "index", "type": "uint256" } ], "name": "tokenOfOwnerByIndex", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "tokenURI", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "totalSupply", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "address", "name": "from", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "transferFrom", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "transferOwnership", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "uint256", "name": "tokenId", "type": "uint256" } ], "name": "mint", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" } ]

Project Resources