-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsandbox.js
64 lines (52 loc) · 2.01 KB
/
sandbox.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
const Tokenmon = require('./Tokenmon');
const HDWalletProvider = require('@truffle/hdwallet-provider');
const cpt = require('./cryptography');
// This import is required to get the bytecode/abi of the smart contract.
const my_contract = require('./Contract');
const my_provider = new HDWalletProvider(
// 12word mnemonic for the account to deploy the contract (must have some ether)
'cart remind main urban turn west isolate south deal liquid into left',
// link to network (in this case Rinkeby test network)
'https://rinkeby.infura.io/v3/ca6249643afa4dabbed3e314bbae53ef'
);
var tok = new Tokenmon(
my_provider,
{
"nftstorage_apikey":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkaWQ6ZXRocjoweDFBMEE3ODJlZmRBRmUxRmFiMWE2NjBEYzUwZTg1MDE3YTMxODIxNDUiLCJpc3MiOiJuZnQtc3RvcmFnZSIsImlhdCI6MTYyNjg2MDk1NTgzOCwibmFtZSI6InRlc3QifQ.lySWBgIWC6YxBcKo2CKHWqODWHePpJokOMpaJuXh5d0",
"web3storage_apikey":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkaWQ6ZXRocjoweDM1QTMxZjNCNzQwNmE3ZTcwQUUwMDZBQTE4QjMxQ0ExZTg1MTNDRkYiLCJpc3MiOiJ3ZWIzLXN0b3JhZ2UiLCJpYXQiOjE2MjkyMjQzMzIyMzcsIm5hbWUiOiJ0b2tlbm1vbmJldGEifQ.QDe0h8ClUbpfyttqssCahs-x2sEhvRsGYbnq1ykUlMA"
},
my_contract
);
tok.init().then(()=>{
tok.upload(
'Makunga Alonso',
'Makunga Alonso, two-time formula one world champion. Goat.',
{
'racepace' : 'outstanding',
'wdc' : '2'
},
'img/nanopodio.jpg',
'img/nanopodio_cover.jpg'
);
});
/*tok.init().then(()=>{
tok.update(
"finaltok10.nyxto.eth",
'Ungabunga Vettel',
'Ungabunga Vettel, four-time formula one world champion.',
{
'racepace' : 'excellent',
'wdc' : '4'
},
'img/sebhm_cover.jpg',
'img/sebhm_cover.jpg'
);
});*/
/*tok.init().then(()=>{
tok.breakSeal(
"10",
"finaltok10.nyxto.eth",
cpt.getKeys("finaltok10.nyxto.eth")["owner"],
cpt.getKeys("finaltok10.nyxto.eth")["company"]
);
});*/