The capstone will build upon the knowledge you have gained in the course in order to build a decentralized housing product.
Truffle v5.1.14-nodeLTS.0 (core: 5.1.13) Node v12.13.1
npm install
truffle compile
truffle migrate --network rinkeby
Compiling your contracts...
===========================
> Compiling ./contracts/ERC721Mintable.sol
> Compiling ./contracts/Migrations.sol
> Compiling ./contracts/Oraclize.sol
> Compiling ./contracts/SolnSquareVerifier.sol
> Compiling ./contracts/Verifier.sol
> Compiling ./../node_modules/openzeppelin-solidity/contracts/drafts/Counters.sol
> Compiling ./../node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol
> Compiling ./../node_modules/openzeppelin-solidity/contracts/token/ERC721/IERC721Receiver.sol
> Compiling ./../node_modules/openzeppelin-solidity/contracts/utils/Address.sol
Migrations dry-run (simulation)
===============================
> Network name: 'rinkeby-fork'
> Network id: 4
> Block gas limit: 0x989680
1_initial_migration.js
======================
Deploying 'Migrations'
----------------------
> block number: 6698932
> block timestamp: 1592639466
> account: 0x038713E0fd6CE9F51393a744Cb14BEC1bA951460
> balance: 10.538736434000000001
> gas used: 210237
> gas price: 10 gwei
> value sent: 0 ETH
> total cost: 0.00210237 ETH
-------------------------------------
> Total cost: 0.00210237 ETH
2_deploy_contracts.js
=====================
Deploying 'Verifier'
--------------------
> block number: 6698934
> block timestamp: 1592639489
> account: 0x038713E0fd6CE9F51393a744Cb14BEC1bA951460
> balance: 10.524516734000000001
> gas used: 1394607
> gas price: 10 gwei
> value sent: 0 ETH
> total cost: 0.01394607 ETH
Deploying 'SolnSquareVerifier'
------------------------------
> block number: 6698935
> block timestamp: 1592639612
> account: 0x038713E0fd6CE9F51393a744Cb14BEC1bA951460
> balance: 10.492352534000000001
> gas used: 3216420
> gas price: 10 gwei
> value sent: 0 ETH
> total cost: 0.0321642 ETH
-------------------------------------
> Total cost: 0.04611027 ETH
Summary
=======
> Total deployments: 3
> Final cost: 0.04821264 ETH
Starting migrations...
======================
> Network name: 'rinkeby'
> Network id: 4
> Block gas limit: 0x989680
1_initial_migration.js
======================
Deploying 'Migrations'
----------------------
> transaction hash: 0x0f3ef0af8247d6e2623b6fc2ae733175966b42ec6e9273fb8043c6d424d9242e
> Blocks: 0 Seconds: 10
> contract address: 0x6F824675Bd7532d7AAEeCb11e888519A40c7875E
> block number: 6698947
> block timestamp: 1592639679
> account: 0x038713E0fd6CE9F51393a744Cb14BEC1bA951460
> balance: 10.538586434000000001
> gas used: 225237
> gas price: 10 gwei
> value sent: 0 ETH
> total cost: 0.00225237 ETH
> Saving migration to chain.
> Saving artifacts
-------------------------------------
> Total cost: 0.00225237 ETH
2_deploy_contracts.js
=====================
Deploying 'Verifier'
--------------------
> transaction hash: 0xf3b061879001148d2d3562e655579e6279b28e4379fae0046950d8536e373492
> Blocks: 1 Seconds: 22
> contract address: 0x725e7233Abd07CE4AE5dBF592b3f580941B554e5
> block number: 6698950
> block timestamp: 1592639724
> account: 0x038713E0fd6CE9F51393a744Cb14BEC1bA951460
> balance: 10.524216734000000001
> gas used: 1394607
> gas price: 10 gwei
> value sent: 0 ETH
> total cost: 0.01394607 ETH
Deploying 'SolnSquareVerifier'
------------------------------
> transaction hash: 0x4800706563a05d06e66ffb1e64250ddc586416e4ddd29a3ff2a21cc668a7cf3e
> Blocks: 2 Seconds: 26
> contract address: 0x79d14Cde6467dd868D7e000991984e3Fa1A20a82
> block number: 6698953
> block timestamp: 1592639769
> account: 0x038713E0fd6CE9F51393a744Cb14BEC1bA951460
> balance: 10.490402534000000001
> gas used: 3381420
> gas price: 10 gwei
> value sent: 0 ETH
> total cost: 0.0338142 ETH
> Saving migration to chain.
> Saving artifacts
-------------------------------------
> Total cost: 0.04776027 ETH
Summary
=======
> Total deployments: 3
> Final cost: 0.05001264 ETH
- To get SolnSquareVerifierABI move to
build/contracts/solSquareVerifier.json
and copy all under ABI which is like
[
{
"inputs": [
{
"internalType": "address",
"name": "verifierAddress",
"type": "address"
}
],
"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": "caller",
"type": "address"
}
],
"name": "Paused",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "SolutionAdded",
"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": "newOwner",
"type": "address"
}
],
"name": "TransferredOwneship",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "caller",
"type": "address"
}
],
"name": "Unpaused",
"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": 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"
},
{
"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": [
{
"internalType": "bool",
"name": "isPaused",
"type": "bool"
}
],
"name": "pause",
"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": 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": "bytes32",
"name": "solutionId",
"type": "bytes32"
},
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
},
{
"internalType": "address",
"name": "solnAccount",
"type": "address"
}
],
"name": "addSolution",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
},
{
"internalType": "uint256[2]",
"name": "a",
"type": "uint256[2]"
},
{
"internalType": "uint256[2]",
"name": "a_p",
"type": "uint256[2]"
},
{
"internalType": "uint256[2][2]",
"name": "b",
"type": "uint256[2][2]"
},
{
"internalType": "uint256[2]",
"name": "b_p",
"type": "uint256[2]"
},
{
"internalType": "uint256[2]",
"name": "c",
"type": "uint256[2]"
},
{
"internalType": "uint256[2]",
"name": "c_p",
"type": "uint256[2]"
},
{
"internalType": "uint256[2]",
"name": "h",
"type": "uint256[2]"
},
{
"internalType": "uint256[2]",
"name": "k",
"type": "uint256[2]"
},
{
"internalType": "uint256[2]",
"name": "input",
"type": "uint256[2]"
}
],
"name": "mintNFT",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
}
]
- Now visit https://www.myetherwallet.com/interface/interact-with-contract and enter your contract address and make sure you are logged in metamask with the same seed phrase used to deploy the contract
- Then paste ABI and click next
- on the last window MIT some tokens and generate 10 tokens.
- finally vist https://rinkeby.opensea.io/get-listed/step-two to list your tokens for.
- Using other account buy 5 tokens
0x79d14Cde6467dd868D7e000991984e3Fa1A20a82
0x038713E0fd6CE9F51393a744Cb14BEC1bA951460