Skip to content
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.

Commit

Permalink
new buidler tasks for gelatocore
Browse files Browse the repository at this point in the history
  • Loading branch information
gitpusha committed Feb 4, 2020
1 parent dab962c commit 6d93e18
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Mint
import "./task.mintExecutionClaim";
// Get Minting Deposit Payable
import "./task.getMintingDepositPayable"
import "./task.getMintingDepositPayable";

import "./task.getCurrentExecutionClaimId";

// == Sub_Tasks ===
import "./sub_tasks/collection.sTasks.minting";
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { task } from "@nomiclabs/buidler/config";
import { defaultNetwork } from "../../../../../buidler.config";

export default task(
"gc-getcurrentexecutionclaimid",
`Calls GelatoCore.getCurrentExecutionClaimId() on [--network] (default: ${defaultNetwork})`
)
.addFlag("log", "Logs return values to stdout")
.setAction(async ({ log }) => {
try {
const gelatoCoreContract = await run("instantiateContract", {
contractname: "GelatoCore",
read: true
});

const currentExecutionClaimId = await gelatoCoreContract.getCurrentExecutionClaimId();
if (log) {
console.log(
`\n GelatoCore current ExecutionClaimId: ${currentExecutionClaimId}`
);
}
return currentExecutionClaimId;
} catch (error) {
console.error(error);
process.exit(1);
}
});
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
import "./task.createUserProxy";
import "./task.proxyByUser";
import "./task.users";
import "./task.userCount"
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { task } from "@nomiclabs/buidler/config";
import { defaultNetwork } from "../../../../../buidler.config";

export default task(
"gc-usercount",
`Calls GelatoCore.usercount() on [--network] (default: ${defaultNetwork})`
)
.addFlag("log", "Logs return values to stdout")
.setAction(async ({ log }) => {
try {
const gelatoCoreContract = await run("instantiateContract", {
contractname: "GelatoCore",
read: true
});

const userCount = await gelatoCoreContract.userCount();
if (log) console.log(`\n GelatoCore number of users: ${userCount}`);
return userCount;
} catch (error) {
console.error(error);
process.exit(1);
}
});
23 changes: 23 additions & 0 deletions scripts/buidler_tasks/gelato/core/user_proxy_manager/task.users.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { task } from "@nomiclabs/buidler/config";
import { defaultNetwork } from "../../../../../buidler.config";

export default task(
"gc-users",
`Calls GelatoCore.users() on [--network] (default: ${defaultNetwork})`
)
.addFlag("log", "Logs return values to stdout")
.setAction(async ({ log }) => {
try {
const gelatoCoreContract = await run("instantiateContract", {
contractname: "GelatoCore",
read: true
});

const users = await gelatoCoreContract.users();
if (log) console.log(`\n GelatoCore Users: \n ${users}`);
return users;
} catch (error) {
console.error(error);
process.exit(1);
}
});

0 comments on commit 6d93e18

Please sign in to comment.