Skip to content

Instantly share code, notes, and snippets.

Avatar

James Morgan jamesmorgan

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am jamesmorgan on github.
  • I am jimbobbins (https://keybase.io/jimbobbins) on keybase.
  • I have a public key ASDJX-FTTS6FHG0_HJcGRAdgzch4rm2N1q_boL8en4HdGQo

To claim this, I am signing this object:

View revert-reasons.js
try {
await contract.methodCall();
} catch (error) {
// error.reason now populated with an REVERT reason
console.log("Failure reason", error.reason);
}
View truffle.js
{
live: {
network_id: 1,
gas: 6075039,
gasPrice: 5000000000,
timeoutBlocks: 200, // # of blocks before a deployment times out (minimum/default: 50)
skipDryRun: true // Skip dry run before migrations? (default: false for public nets )
}
}
@jamesmorgan
jamesmorgan / transaction-handling.js
Last active Sep 29, 2019
transaction-handling.js
View transaction-handling.js
contract
.purchase(edition.edition, {
from: account,
value: priceInWei
})
.on('transactionHash', hash => {
console.log('Purchase transaction submitted', hash);
})
.on('receipt', receipt => {
console.log('Purchase successful - Ive been mined', receipt);
@jamesmorgan
jamesmorgan / erc-721-enhanced-metadata.json
Last active Sep 29, 2019
erc-721-enhanced-metadata.json
View erc-721-enhanced-metadata.json
{
"title": "Asset Metadata",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Identifies the asset to which this NFT represents",
},
"description": {
"type": "string",
View custommeta.json
{
"artist": "Paper Hawk",
"artworkName": "Buzz",
"description": "Paper collage, using salvaged and original watercolour papers"
}
@jamesmorgan
jamesmorgan / metadata.json
Last active Sep 29, 2019
metadata example
View metadata.json
{
"name": "Buzz",
"description": "Paper collage, using salvaged and original watercolour papers",
"image": "https://ipfs.infura.io/ipfs/QmWc6YHE815F8kExchG9kd2uSsv7ZF1iQNn23bt5iKC6K3/image",
"meta": "https://ipfs.infura.io/ipfs/QmWc6YHE815F8kExchG9kd2uSsv7ZF1iQNn23bt5iKC6K3/other"
}
@jamesmorgan
jamesmorgan / KODA-mint.sol
Created Apr 12, 2018
KnownOriginDigitalAssets mint() method example
View KODA-mint.sol
function mint(string _tokenURI, bytes16 _edition, uint256 _priceInWei, uint32 _auctionStartDate, address _artistAccount) external onlyKnownOrigin {
....
}
View erc721-metadata-standards.json
{
"title": "Asset Metadata",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Identifies the asset to which this NFT represents",
},
"description": {
"type": "string",
You can’t perform that action at this time.