Skip to content

Instantly share code, notes, and snippets.

View merlox's full-sized avatar
😄
Building great things together!

merlox merlox

😄
Building great things together!
View GitHub Profile
import React from 'react'
import ReactDOM from 'react-dom'
import './index.css'
class Main extends React.Component {
constructor() {
super()
}
render() {
body {
margin: 0;
font-family: sans-serif;
text-align: center;
}
button {
border-radius: 10px;
padding: 20px;
color: white;
// To configure new ERC721 assets
async displayBlueprint() {
const cert = new Cert({
schema: schema88
})
const asset = {
description: 'A lighthouse watercolor picture',
image: 'https://upload.wikimedia.org/wikipedia/commons/a/a3/Taran_Lighthouse_Kalinigrad_Oblast_Tatiana_Yagunova_Watercolor_painting.jpg',
name: 'Lighthouse Watercolor'
}
import React from 'react'
import ReactDOM from 'react-dom'
import './index.css'
import { MetamaskProvider } from '@0xcert/ethereum-metamask-provider'
import { schema88 } from '@0xcert/conventions'
import { Cert } from '@0xcert/cert'
import { AssetLedger, AssetLedgerCapability } from '@0xcert/ethereum-asset-ledger'
// Assets Ledgers are groups of tokens that are managed by certain users just like mods in a chat to do what's required
// The Capabilities determine what those mods can do with the assets they are managing
import React from 'react'
import ReactDOM from 'react-dom'
import { MetamaskProvider } from '@0xcert/ethereum-metamask-provider'
import { schema88 } from '@0xcert/conventions'
import { Cert } from '@0xcert/cert'
// Assets Ledgers are groups of tokens that are managed by certain users just like mods in a chat to do what's required
// The Capabilities determine what those mods can do with the assets they are managing
// The Ethereum address that deploys this ledger has full powers to do whatever he wants as the administrator
import { AssetLedger, AssetLedgerCapability } from '@0xcert/ethereum-asset-ledger'
import './index.css'
[
{
"path":[
],
"nodes":[
{
"index":1,
"hash":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
},
{
"$evidence": "https://raw.githubusercontent.com/merlox/art-marketplace/master/evidence.json",
"$schema": "http://json-schema.org/draft-07/schema",
"$name": "Lighthouse Watercolor",
"$image": "https://upload.wikimedia.org/wikipedia/commons/a/a3/Taran_Lighthouse_Kalinigrad_Oblast_Tatiana_Yagunova_Watercolor_painting.jpg"
}
// To create a new asset ledger containing several assets and managed by several individuals
// The asset ledger is mandatory to create new assets since they need a place to be stored, they can't exist without a ledger
async deployNewLedger() {
let deployedLedger = {}
// The required keys are name, symbol, uriBase and schemaId
const recipe = {
name: 'Art Piece',
symbol: 'ART',
uriBase: 'www.example.com/tokenMetadata/', // This is a demonstration, you have to setup a server for generating tokens to this URI
import React from 'react'
import ReactDOM from 'react-dom'
import { MetamaskProvider } from '@0xcert/ethereum-metamask-provider'
import { schema88 } from '@0xcert/conventions'
import { Cert } from '@0xcert/cert'
// Assets Ledgers are groups of tokens that are managed by certain users just like mods in a chat to do what's required
// The Capabilities determine what those mods can do with the assets they are managing
// The Ethereum address that deploys this ledger has full powers to do whatever he wants as the administrator
import { AssetLedger, AssetLedgerCapability } from '@0xcert/ethereum-asset-ledger'
import './index.css'
import React from 'react'
import ReactDOM from 'react-dom'
import { MetamaskProvider } from '@0xcert/ethereum-metamask-provider'
import { schema88 } from '@0xcert/conventions'
import { Cert } from '@0xcert/cert'
// Assets Ledgers are groups of tokens that are managed by certain users just like mods in a chat to do what's required
// The Capabilities determine what those mods can do with the assets they are managing
// The Ethereum address that deploys this ledger has full powers to do whatever he wants as the administrator
import { AssetLedger, AssetLedgerCapability } from '@0xcert/ethereum-asset-ledger'
import './index.css'