Skip to content

Instantly share code, notes, and snippets.

@e00dan
Created September 15, 2021 21:34
Show Gist options
  • Save e00dan/3218ccf8d547e2e369355e2e1e071479 to your computer and use it in GitHub Desktop.
Save e00dan/3218ccf8d547e2e369355e2e1e071479 to your computer and use it in GitHub Desktop.
const { existsSync } = require('fs');
const Web3 = require('web3');
const { PolyjuiceHttpProvider, PolyjuiceAccounts } = require("@polyjuice-provider/web3");
const polyjuiceConfig = {
web3Url: 'https://godwoken-testnet-web3-rpc.ckbapp.dev'
};
const provider = new PolyjuiceHttpProvider(
polyjuiceConfig.web3Url,
polyjuiceConfig,
);
const web3 = new Web3(provider);
web3.eth.accounts = new PolyjuiceAccounts(polyjuiceConfig);
web3.eth.Contract.setProvider(provider, web3.eth.accounts);
const HASH = '0xb017ce8cfdaa552b8c9f4490c77c98e69754ea194dffc62b0ebfd809d3c1f1f4';
(async () => {
const receipt = await web3.eth.getTransactionReceipt(HASH);
console.log(`receipt: `, {
receipt
});
})();
function getBytecodeFromArtifact(contractArtifact) {
return contractArtifact.bytecode || contractArtifact.data?.bytecode?.object
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment