-
Notifications
You must be signed in to change notification settings - Fork 610
Removes web3 from the owner script #1336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
1581d14
c112727
092305d
b2346e8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| 'use strict'; | ||
|
|
||
| const Web3 = require('web3'); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since owner.js is no longer passing a build web3 instance to this util, this util is now in charge of building it for itself. |
||
| const w3utils = require('web3-utils'); | ||
| const axios = require('axios'); | ||
| const { green, gray, red, yellow } = require('chalk'); | ||
|
|
@@ -63,7 +64,11 @@ const safeTransactionApi = ({ network, safeAddress }) => { | |
| return `https://safe-transaction.${network}.gnosis.io/api/v1/safes/${address}/multisig-transactions/`; | ||
| }; | ||
|
|
||
| const getSafeInstance = (web3, safeAddress) => { | ||
| const getSafeInstance = (web3, providerUrl, safeAddress) => { | ||
| if (!web3) { | ||
| web3 = new Web3(new Web3.providers.HttpProvider(providerUrl)); | ||
| } | ||
|
|
||
| return new web3.eth.Contract(abi, safeAddress); | ||
| }; | ||
|
|
||
|
|
@@ -239,7 +244,13 @@ const getNewTransactionHash = async ({ safeContract, data, to, sender, network, | |
| return { txHash, newNonce }; | ||
| }; | ||
|
|
||
| const getSafeSignature = ({ signer, contractTxHash }) => { | ||
| const getSafeSignature = ({ signer, privateKey, providerUrl, contractTxHash }) => { | ||
| if (!signer) { | ||
| const web3 = new Web3(new Web3.providers.HttpProvider(providerUrl)); | ||
|
|
||
| signer = web3.eth.accounts.wallet.add(privateKey); | ||
| } | ||
|
|
||
| // sign txHash to get signature | ||
| const { signature } = signer.sign(contractTxHash); | ||
|
|
||
|
|
||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.