Skip to content

Commit

Permalink
Merge pull request #46 from WrappedBTC/wdoge
Browse files Browse the repository at this point in the history
feat(wrapped-assets): add WDOGE contract
  • Loading branch information
sachushaji authored Sep 22, 2022
2 parents 753c585 + d87996d commit f16501c
Show file tree
Hide file tree
Showing 6 changed files with 1,956 additions and 1,105 deletions.
4 changes: 2 additions & 2 deletions ethereumV2/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This repository has the contracts that implement the wrapped btc token on Ethereum network.
This repository has the contracts that implement the wrapped token for BTC, DOGE, ETH and XRP on Ethereum network.

# Installation

Expand All @@ -18,4 +18,4 @@ This repository has the contracts that implement the wrapped btc token on Ethere

# Deployment

node deployer.js --input-file [file] --gas-price-gwei [gwei] --rpc-url [url]
node deployer.js --input-file [file] --gas-price-gwei [gwei] --rpc-url [url] ----token-name [string] --dont-send-tx [bool] --skip-add-members [bool]
12 changes: 12 additions & 0 deletions ethereumV2/contracts/token/WDOGE.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
pragma solidity 0.4.24;

import "openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol";
import "openzeppelin-solidity/contracts/token/ERC20/DetailedERC20.sol";
import "openzeppelin-solidity/contracts/token/ERC20/MintableToken.sol";
import "openzeppelin-solidity/contracts/token/ERC20/BurnableToken.sol";
import "openzeppelin-solidity/contracts/token/ERC20/PausableToken.sol";
import "../token/WrappedToken.sol";


contract WDOGE is WrappedToken, DetailedERC20("Wrapped DOGE", "WDOGE", 8) {}

8 changes: 4 additions & 4 deletions ethereumV2/deployer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

process.on('unhandledRejection', console.error.bind(console))

const { inputFile, gasPriceGwei, rpcUrl, dontSendTx } = require('yargs')
.usage('Usage: $0 --input-file [file] --gas-price-gwei [gwei] --rpc-url [url] --dont-send-tx [bool]')
.demandOption(['inputFile', 'gasPriceGwei', 'rpcUrl'])
const { inputFile, gasPriceGwei, rpcUrl, dontSendTx, tokenName, skipAddMembers } = require('yargs')
.usage('Usage: $0 --input-file [file] --gas-price-gwei [gwei] --rpc-url [url] --dont-send-tx [bool] --token-name [string] --skip-add-members [bool]')
.demandOption(['inputFile', 'gasPriceGwei', 'rpcUrl', 'tokenName'])
.boolean('dontSendTx')
.argv;

const deployer = require("./deployerImplementation.js");
deployer.deploy(inputFile, gasPriceGwei, rpcUrl, dontSendTx);
deployer.deploy(inputFile, gasPriceGwei, rpcUrl, dontSendTx, tokenName, skipAddMembers );
69 changes: 51 additions & 18 deletions ethereumV2/deployerImplementation.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports.deploy = async function (inputFile, gasPriceGwei, rpcUrl, dontSendTx, tokenName) {
module.exports.deploy = async function (inputFile, gasPriceGwei, rpcUrl, dontSendTx, tokenName, skipAddMembers = false) {

const Web3 = require("web3");
const fs = require("fs");
Expand Down Expand Up @@ -217,11 +217,23 @@ module.exports.deploy = async function (inputFile, gasPriceGwei, rpcUrl, dontSen

////////////////////////////////////////////////////////////

console.log("membersContract.methods.setCustodian: " + accountCustodianAddress)
await sendTx(membersContract.methods.setCustodian(accountCustodianAddress), account);

console.log("membersContract.methods.addMerchant: " + accountMerchantAddress)
await sendTx(membersContract.methods.addMerchant(accountMerchantAddress), account);
if (!skipAddMembers) {
console.log(
"membersContract.methods.setCustodian: " + accountCustodianAddress
);
await sendTx(
membersContract.methods.setCustodian(accountCustodianAddress),
account
);

console.log(
"membersContract.methods.addMerchant: " + accountMerchantAddress
);
await sendTx(
membersContract.methods.addMerchant(accountMerchantAddress),
account
);
}

////////////////////////////////////////////////////////////

Expand All @@ -233,20 +245,41 @@ module.exports.deploy = async function (inputFile, gasPriceGwei, rpcUrl, dontSen

////////////////////////////////////////////////////////////

console.log("waiting to make sure the custodian and merchant were added on chain.")
console.log("waiting to make sure transactions were added on chain.")
await sleep(20000)

nonce = await web3.eth.getTransactionCount(accountCustodianAddress);
console.log("accountCustodianAddress nonce: " + nonce);
let custodianDepositAddress = "1JPhiNBhZzBgWwjG6zaDchmXZyTyUN5Qny";
console.log("factoryContract.methods.setCustodianDepositAddress: " + accountMerchantAddress + ", " + custodianDepositAddress);
await sendTx(factoryContract.methods.setCustodianDepositAddress(accountMerchantAddress, custodianDepositAddress), accountCustodian);

nonce = await web3.eth.getTransactionCount(accountMerchantAddress);
console.log("accountMerchantAddress nonce: " + nonce);
let merchantDepositAddress = "1E57B5SCkGVhFxDugko3quHxamPgkS8NxJ";
console.log("factoryContract.methods.setMerchantDepositAddress: " + merchantDepositAddress);
await sendTx(factoryContract.methods.setMerchantDepositAddress(merchantDepositAddress), accountMerchant);
if (!skipAddMembers) {
nonce = await web3.eth.getTransactionCount(accountCustodianAddress);
console.log("accountCustodianAddress nonce: " + nonce);
let custodianDepositAddress = "1JPhiNBhZzBgWwjG6zaDchmXZyTyUN5Qny";
console.log(
"factoryContract.methods.setCustodianDepositAddress: " +
accountMerchantAddress +
", " +
custodianDepositAddress
);
await sendTx(
factoryContract.methods.setCustodianDepositAddress(
accountMerchantAddress,
custodianDepositAddress
),
accountCustodian
);

nonce = await web3.eth.getTransactionCount(accountMerchantAddress);
console.log("accountMerchantAddress nonce: " + nonce);
let merchantDepositAddress = "1E57B5SCkGVhFxDugko3quHxamPgkS8NxJ";
console.log(
"factoryContract.methods.setMerchantDepositAddress: " +
merchantDepositAddress
);
await sendTx(
factoryContract.methods.setMerchantDepositAddress(
merchantDepositAddress
),
accountMerchant
);
}

nonce = await web3.eth.getTransactionCount(sender);

Expand Down
Loading

0 comments on commit f16501c

Please sign in to comment.