-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added script for mint(), sendToWinners().
- Loading branch information
Showing
3 changed files
with
26 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const Mushroom = artifacts.require("Mushroom"); | ||
const MushroomReceiver = artifacts.require("MushroomReceiver"); | ||
|
||
module.exports = async function (deployer) { | ||
let mush = await Mushroom.deployed(); | ||
let mushR = await MushroomReceiver.deployed(); | ||
|
||
const account = (await web3.eth.getAccounts())[0]; | ||
await mush.mint(mushR.address); | ||
await mushR.sendToWinners(mush.address, account, 0, (20).toString()); | ||
|
||
await mush | ||
.balanceOf(account, 0) | ||
.then((d) => console.log("My balance: ", d.toString())); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,15 @@ | ||
const Mushroom = artifacts.require("Mushroom"); | ||
const MushroomReceiver = artifacts.require("MushroomReceiver"); | ||
|
||
module.exports = async function () { | ||
const Mushroom = await artifacts.require("Mushroom").deployed(); | ||
const MushroomReceiver = await artifacts.require("MushroomReceiver").deployed(); | ||
const mush = new web3.eth.Contract(Mushroom.abi, Mushroom.address); | ||
const mushR = new web3.eth.Contract(MushroomReceiver.abi, MushroomReceiver.address); | ||
|
||
module.exports = async function (){ | ||
mush = await Mushroom.deployed(); | ||
mushR = await MushroomReceiver.deployed(); | ||
|
||
console.log(mush); | ||
console.log(mushR); | ||
const accounts = await web3.eth.getAccounts(); | ||
|
||
// myAccount = (await web3.eth.getAccounts())[0]; | ||
// await mush.mint(mushR.address); | ||
// await mushR.sendToWinners(mush.address, myAccount, 0, (10).toString()); | ||
} | ||
// Create the token via mint() | ||
await mush.methods.mint(mushR).send({from: accounts[0]}); | ||
|
||
}; | ||
// Create the token via mint() | ||
|
||
// Distribute the token via sendToWinners() |