Using unlocked accounts with ganache --fork & --unlock #1938
Unanswered
dapp-whisperer
asked this question in
Q&A
Replies: 2 comments
-
I had once used address to get a ganache signer, maybe that should work const provider = ethers.providers.Web3Provider(ganacheProvider)
const signer = provider.getSigner('0xyouraddress');
await signer.sendTransaction({
to: '0xdestnation',
value: '10000'
}) |
Beta Was this translation helpful? Give feedback.
0 replies
This comment was marked as spam.
This comment was marked as spam.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Using ganache with the --fork and --unlock options allows for 'taking over' mainnet addresses on a local fork, which is extremely useful for testing complex defi interactions.
With web3js, you can 'own' these unlocked accounts just by using them in the 'from' field of a TX, without having the private key.
(Assume
0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe
is the unlocked account from the CLI)I'm not an expert on ethers, but I'm not sure how this feature can be replicated with the Signer paradigm.
Beta Was this translation helpful? Give feedback.
All reactions