Compare commits

..

No commits in common. "a4fcf451f54718929de6eec18c04e419b595029b" and "4b4922e40b2bf28dbe5c0fb3eacded2b697ef844" have entirely different histories.

2 changed files with 2 additions and 37 deletions

View File

@ -8,11 +8,8 @@ module.exports = async (callback) => {
console.log(`Name: "${name}", symbol: "${symbol}"`);
const { 0:receiver, 1:hexAmount} = await wrapper.royaltyInfo(1, "1000000000000000000");
console.log(`Default royalty recipient: ${receiver}`);
const ubiqAmount = web3.utils.fromWei(hexAmount, "ether");
console.log(`Royalty on a 1 Ubiq fee: ${ubiqAmount}`);
const royaltyInfo = await wrapper.royaltyInfo(1, "10000000000");
console.log(JSON.stringify(royaltyInfo, null, 4));
callback();
}

View File

@ -1,32 +0,0 @@
const Wrapper = artifacts.require("CurioERC1155Wrapper");
const MAX = 7.5;
module.exports = async (callback) => {
const receiver = process.argv[6];
if (/0x[0-9a-fA-F]{40}/.test(receiver)) {
const percentage = parseFloat(process.argv[7]);
if (percentage > 0 && percentage <= MAX) {
const numerator = Math.ceil(percentage * 100);
console.log(`Numerator to be used: ${numerator}`);
const wrapper = await Wrapper.deployed();
console.log("Exeuting transaction...");
try {
await wrapper.setDefaultRoyalty(receiver, numerator);
}
catch (e) {
console.error(`FAILED: ${e}`);
}
}
else {
console.error(`Royalty must be greater than zero and less than %${percentage}`);
}
}
else {
console.error("Invalid receiver address");
}
callback();
}