Skip to content
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

Add getCode() method to JsonRpcProvider #95

Closed
arimgibson opened this issue Apr 23, 2022 · 1 comment · Fixed by #126
Closed

Add getCode() method to JsonRpcProvider #95

arimgibson opened this issue Apr 23, 2022 · 1 comment · Fixed by #126
Assignees
Labels
enhancement New feature or request

Comments

@arimgibson
Copy link
Contributor

arimgibson commented Apr 23, 2022

Should return the contract code of a given address on a given block. Uses the eth_getCode RPC call.

ethers.js equivalent - provider.getCode

const essentialEth = require('essential-eth');
const provider = new essentialEth.JsonRpcProvider();
provider.getCode('0x6fc21092da55b392b045ed78f4732bff3c580e2c', 14642060);
// '0x6060604052...'
// Value extremely long and spans multiple lines, this is the first bit of data returned
@arimgibson arimgibson added the enhancement New feature or request label Apr 23, 2022
@dawsbot
Copy link
Owner

dawsbot commented Apr 24, 2022

@arimgibson Keep in mind that essential-eth does not yet support ENS until #23 is completed. So the code example above would need the full "0x" address instead of the ".eth" domain

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants