-
Notifications
You must be signed in to change notification settings - Fork 36
Update web3, ethers (migrates to BigInt); Replace truffle/ganache with hardhat/geth #206
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
Open
kajoseph
wants to merge
6
commits into
bitpay:master
Choose a base branch
from
kajoseph:updateWeb3
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e6b51e8
upgrade web3 & ethers; migrate truffle => hardhat
kajoseph e7bffc7
address feedback
kajoseph 179896f
fix div by zero; clean and dry up get & send tx rpc calls
kajoseph 7e1a4e6
cleanup w/ optional chaining
kajoseph 0f8dbd0
cleanup erc20rpc
kajoseph 632978e
revert to transactionHash event listener for performance reasons
kajoseph File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,34 @@ | ||
| require('@nomicfoundation/hardhat-ethers'); | ||
| require('@nomicfoundation/hardhat-ignition-ethers'); | ||
|
|
||
| /** @type import('hardhat/config').HardhatUserConfig */ | ||
| module.exports = { | ||
| solidity: { | ||
| compilers: [ | ||
| { version: '0.4.24' }, | ||
| // add more here | ||
| ] | ||
| }, | ||
| ignition: { | ||
| requiredConfirmations: 1 | ||
| }, | ||
| networks: { | ||
| geth: { | ||
| url: `http://geth:8545`, | ||
| gas: 4700000, | ||
| chainId: 1337 | ||
| }, | ||
| local: { | ||
| url: process.env.HARDHAT_URL || 'http://localhost:8545', | ||
| gas: 4700000, | ||
| chainId: 1337 | ||
| } | ||
| }, | ||
| paths: { | ||
| sources: './contracts', | ||
| tests: './test', | ||
| cache: './cache', | ||
| artifacts: './artifacts', | ||
| modules: './ignition/modules' | ||
| } | ||
| }; |
This file contains hidden or 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,29 @@ | ||
| const hardhat = require('hardhat'); | ||
| const { buildModule } = require('@nomicfoundation/hardhat-ignition/modules'); | ||
| const fs = require('fs'); | ||
|
|
||
| const sequential = process.env.HH_SEQUENTIAL_DEPLOY == '1' || hardhat.network.config['sequentialDeploy']; | ||
| if (sequential) { | ||
| // eslint-disable-next-line no-console | ||
| console.log('Sequential deployment enabled'); | ||
| } | ||
|
|
||
|
|
||
| module.exports = buildModule('Deploy_All', (m) => { | ||
| const mods = fs.readdirSync(__dirname); | ||
| let prev; | ||
| for (const mod of mods) { | ||
| if (mod === __filename.split('/').pop()) { | ||
| continue; | ||
| } | ||
| const contracts = m.useModule(require(`${__dirname}/${mod}`)); | ||
| if (sequential) { // sequentially deploy the contracts instead of in parallel | ||
| if (prev) { | ||
| for (const contract of Object.values(contracts)) { | ||
| contract.dependencies.add(prev); | ||
| } | ||
| } | ||
| prev = Object.values(contracts)[0]; | ||
| } | ||
| } | ||
| }); |
This file contains hidden or 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,7 @@ | ||
| const { buildModule } = require('@nomicfoundation/hardhat-ignition/modules'); | ||
|
|
||
|
|
||
| module.exports = buildModule('ERC20', (m) => { | ||
| const contract = m.contract('CryptoErc20'); | ||
| return { contract }; | ||
| }); |
This file contains hidden or 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,7 @@ | ||
| const { buildModule } = require('@nomicfoundation/hardhat-ignition/modules'); | ||
|
|
||
|
|
||
| module.exports = buildModule('SendToMany', (m) => { | ||
| const contract = m.contract('SendToMany'); | ||
| return { contract }; | ||
| }); |
This file contains hidden or 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 hidden or 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 hidden or 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,5 +1,6 @@ | ||
| module.exports = { | ||
| BalanceProgram: require('./bin/balance'), | ||
| SendProgram: require('./bin/send'), | ||
| CryptoRpc: require('./lib') | ||
| CryptoRpc: require('./lib'), | ||
| utils: require('./lib/utils') | ||
| }; |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.