This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.5.0; | |
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/ERC721MetadataMintable.sol"; | |
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/ERC721Enumerable.sol"; | |
contract Cert721 is ERC721MetadataMintable, ERC721Enumerable { | |
constructor (string memory name, string memory symbol) | |
public | |
ERC721Metadata(name, symbol) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"description": "This token certifies the holder as a graduate of the Devcon V Scholars program.", | |
"image": "https://i.ibb.co/mFz0Zjh/deva2019b-2.png", | |
"name": "Devcon V Scholar NFT", | |
"external_url": "https://medium.com/ethereum-foundation-devcon-scholars" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"constant": false, | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "account", | |
"type": "address" | |
} | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.5.0; // Step 1 | |
contract ProjectSubmission { // Step 1 | |
address owner; // Step 1 (state variable) | |
uint ownerBalance; // Step 4 (state variable) | |
modifier onlyOwner() { // Step 1 | |
require(msg.sender == owner, "Only the owner can do this."); | |
_; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity >=0.4.0 <0.7.0; | |
// Rinkeby address: 0x49Bb098E781eD5C50D85E82d85cbA1a6F03FD3e6 | |
contract SimpleStorage { | |
uint storedData; | |
event storageUpdate(uint newValue, address updatedBy); | |
function set(uint x) public { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This exercise has been updated to use Solidity version 0.5 | |
Breaking changes from 0.4 to 0.5 can be found here: | |
https://solidity.readthedocs.io/en/v0.5.0/050-breaking-changes.html | |
Reference Docs: https://solidity.readthedocs.io/en/latest/index.html | |
*/ | |
pragma solidity ^0.5.0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Run this script in a npm project with contractkit installed | |
// https://www.npmjs.com/package/@celo/contractkit | |
const Kit = require('@celo/contractkit') | |
const CeloContract = Kit.CeloContract | |
const kit = Kit.newKit('http://localhost:8545') | |
async function wrapper(){ | |
let accounts = await kit.web3.eth.getAccounts() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Import ContractKit | |
const ContractKit = require('@celo/contractkit') | |
// Create a new instance of ContractKit, connecting to a local Celo node | |
//const contractKit = ContractKit.newKit('http://localhost:8545') | |
const contractKit = ContractKit.newKit('https://alfajores-forno.celo-testnet.org') | |
// Specify an arbitrary recipient of the transaction | |
const recipient = '0xB9727f7f1e1f4a5229a49E260fBBBD410d10f2Ff' | |
const privateKey = '3a26ebc37944c305670a21ea6a5d16c1084db2f18bc6635ba95f487e5c59868f' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// API call: | |
// https://explorer.celo.org/api?module=transaction&action=gettxinfo&txhash=0xc495463ca93ec63fa654cc12690db488a9b127221a21af4c6359ceb357f3d757 | |
{ | |
"status": "1", | |
"result": { | |
"value": "0", | |
"to": "0x6d67b41236129cb4f6ffaf6e37223485b20d1d06", | |
"timeStamp": "1610353070", | |
"success": true, | |
"next_page_params": null, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Web3 = require("web3") | |
const ContractKit = require('@celo/contractkit') | |
const web3 = new Web3('https://forno.celo.org') | |
const kit = ContractKit.newKitFromWeb3(web3) | |
let anAddress = '0xD86518b29BB52a5DAC5991eACf09481CE4B0710d' | |
async function signTx(){ | |
let goldtoken = await kit.contracts.getGoldToken() |