Compare commits

..

3 Commits

Author SHA1 Message Date
Moon Man c29b0a0336 query metadata script 2023-01-29 22:21:37 -05:00
Moon Man c4d1ab0b7f function call instead of just function 2023-01-29 22:21:09 -05:00
Moon Man e430270130 fix network id for ubiq 2023-01-29 22:20:37 -05:00
3 changed files with 22 additions and 5 deletions

View File

@ -53,12 +53,12 @@ contract CurioERC1155Wrapper is ERC1155, ERC1155Metadata_URI, ERC1155Metadata, O
return string(abi.encodePacked("data:application/json;base64,", Base64.encode(abi.encodePacked( return string(abi.encodePacked("data:application/json;base64,", Base64.encode(abi.encodePacked(
'{', '{',
'"name":"', curio.name, '",', '"name":"', curio.name(), '",',
'"description":"', curio.description, '",', '"description":"', curio.description(), '",',
'"image":"ipfs://', curio.ipfs_hash, '",', '"image":"ipfs://', curio.ipfs_hash(), '",',
'"external_url":"', urls[_id], '",', '"external_url":"', urls[_id], '",',
'"properties":{', '"properties":{',
'"symbol":"', curio.symbol, '"', '"symbol":"', curio.symbol(), '"',
'}', '}',
'}' '}'
)))); ))));

17
scripts/query-metadata.js Normal file
View File

@ -0,0 +1,17 @@
const Wrapper = artifacts.require("CurioERC1155Wrapper");
module.exports = async (callback) => {
console.log("Start.");
const wrapper = await Wrapper.deployed();
const dataURI = await wrapper.uri(1);
console.log(`Data URI: ${dataURI}`);
const data = dataURI.split(',')[1];
const raw = Buffer.from(data, "base64").toString("utf8");
console.log(JSON.stringify(JSON.parse(raw), null, 4));
console.log("Done.");
callback();
}

View File

@ -55,7 +55,7 @@ module.exports = {
ubiq: { ubiq: {
provider: () => new HDWalletProvider(mnemonic, "https://rpc.octano.dev"), provider: () => new HDWalletProvider(mnemonic, "https://rpc.octano.dev"),
gas: 5500000, gas: 5500000,
network_id: 88, network_id: 8,
confirmations: 2, confirmations: 2,
timeoutBlocks: 200, timeoutBlocks: 200,
skipDryRun: true skipDryRun: true