Skip to content

Commit

Permalink
Merge pull request #1 from manav2401/cleanup
Browse files Browse the repository at this point in the history
Cleanup
  • Loading branch information
manav2401 authored Dec 5, 2021
2 parents 41b1dbe + 1d04f73 commit 14946ac
Show file tree
Hide file tree
Showing 7 changed files with 795 additions and 738 deletions.
19 changes: 19 additions & 0 deletions .env.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

# user's wallet address and private key
USER_ADDRESS=
USER_PRIVATE_KEY=

# biconomy api key
BICONOMY_API_KEY=

# cuperFluid contract (post deployment)
CUPERFLUID_CONTRACT_ADDRESS=

# address of receiver
RECEIVER_ADDRESS=

# backend endpoint for validating
BACKEND_ENDPOINT=

# rpc-provider
RPC_PROVIDER_ENDPOINT=
1 change: 1 addition & 0 deletions contracts/Cuperfluid.sol
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ contract Cuperfluid is ChainlinkClient, SuperAppBase, BaseRelayRecipient {
((stream.iteration + 1) * stream.checkpointInterval)
)
);
// string memory url = "https://secure-fortress-91179.herokuapp.com/validate?token=5c03fe67f60a8dcbc5df674f0a8df8f2&from=1&to=1";
/* solhint-enable not-rely-on-time */

// create new chainlink request
Expand Down
7 changes: 4 additions & 3 deletions hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ require("dotenv").config();
// Go to https://hardhat.org/config/ to learn more

const PRIVATE_KEY = process.env.PRIVATE_KEY || "";
const rpcProvider = process.env.RPC_PROVIDER_ENDPOINT;

/**
* @type import('hardhat/config').HardhatUserConfig
Expand All @@ -23,10 +24,10 @@ module.exports = {
defaultNetwork: "mumbai",
networks: {
mumbai: {
url: "https://rpc-mumbai.maticvigil.com",
url: rpcProvider,
accounts: [PRIVATE_KEY],
gas: 2100000,
gasPrice: 8000000000,
gas: 6721975,
gasPrice: 20000000000,
},
},
solidity: "0.8.0",
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"@openzeppelin/contracts": "^4.3.2",
"@superfluid-finance/ethereum-contracts": "^1.0.0-rc.7",
"dotenv": "^10.0.0",
"eth-sig-util": "^3.0.1"
"eth-sig-util": "^3.0.1",
"solc": "0.8.0"
}
}
20 changes: 10 additions & 10 deletions scripts/2-simulate-sender.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,23 @@ let endStream = false;
async function main() {
console.log("Starting `Sender` Simulation");

// constants
const privateKey = process.env.PRIVATE_KEY || "";
// env vars
const privateKey = process.env.USER_PRIVATE_KEY || "";
const apiKey = process.env.BICONOMY_API_KEY;
const userAddress = "0x0997F9a8647CA45Ab697886143f4353C614e1D7A";
const cuperfluidContractAddress =
"0x921B1DBd4A075E9ad2686E480540F3a07C4A6553";
const userAddress = process.env.USER_ADDRESS;
const cuperfluidContractAddress = process.env.CUPERFLUID_CONTRACT_ADDRESS;
const receiver = process.env.RECEIVER_ADDRESS;
const endpoint = process.env.BACKEND_ENDPOINT || "https://secure-fortress-91179.herokuapp.com/validate";
// constant addresses
const token = "5c03fe67f60a8dcbc5df674f0a8df8f2";
const superfluidContractAddress =
"0xEB796bdb90fFA0f28255275e16936D25d3418603";
"0xEB796bdb90fFA0f28255275e16936D25d3418603";
const cfaContractAddress = "0x49e565Ed1bdc17F3d220f72DF0857C26FA83F873";
const fDAIx = "0x5D8B4C2554aeB7e86F387B4d6c00Ac33499Ed01f";
const receiver = "0xa5a782A2b2BE73421F75774186d4f8f1aAbca2C4";
// constants
const flowRate = 385802469135802; // denotes tokens per sec, equates to 1010 tokens / month
const numberOfCheckpoints = 10;
const checkpointInterval = 60000;
const endpoint = "https://secure-fortress-91179.herokuapp.com/validate";
const token = "5c03fe67f60a8dcbc5df674f0a8df8f2";

// provider and wallet
const provider = new ethers.providers.JsonRpcProvider(
"https://rpc-mumbai.maticvigil.com"
Expand Down
11 changes: 6 additions & 5 deletions scripts/biconomy-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@ const Cuperfluid = require("../artifacts/contracts/Cuperfluid.sol/Cuperfluid.jso
async function main() {
const privateKey = process.env.PRIVATE_KEY;
const apiKey = process.env.BICONOMY_API_KEY;
const cuperfluidContractAddress =
"0xc5610779AC3Ba6Af90aBfd9C345e7f936cA63656";
const userAddress = "0x0997F9a8647CA45Ab697886143f4353C614e1D7A";
const cuperfluidContractAddress = process.env.CUPERFLUID_CONTRACT_ADDRESS;
const userAddress = process.env.USER_ADDRESS;
const fDAIx = "0x5D8B4C2554aeB7e86F387B4d6c00Ac33499Ed01f";
const receiver = "0xdA7773E91a396d592AD33146164dA6d7d2Fda9B6";
const flowRate = 385802469135802;
const numberOfCheckpoints = 10;
const checkpointInterval = 3600;
const endpoint = "https://secure-fortress-91179.herokuapp.com/validate";
const endpoint =
process.env.BACKEND_ENDPOINT ||
"https://secure-fortress-91179.herokuapp.com/validate";
const token = "5c03fe67f60a8dcbc5df674f0a8df8f2";
const address = "0x0997F9a8647CA45Ab697886143f4353C614e1D7A";
const address = process.env.USER_ADDRESS;

const provider = new ethers.providers.JsonRpcProvider(
"https://rpc-mumbai.maticvigil.com"
Expand Down
Loading

0 comments on commit 14946ac

Please sign in to comment.