smartcontractkit / hardhat-starter-kit

A repo for boilerplate code for testing, deploying, and shipping chainlink solidity code.
MIT License
1.21k stars 490 forks source link

Remove `stringToBytes32` #51

Closed PatrickAlphaC closed 2 years ago

PatrickAlphaC commented 2 years ago

We don't need to do this. We should just encode the jobid using ethers.

This is best practice anyways.

pappas999 commented 2 years ago

thanks for raising, makes sense

0xshivamagarwal commented 2 years ago

Hey @pappas999 @PatrickAlphaC , According to my understanding, in APIConsumer.sol stringToBytes32 function call in constructor needs to be removed and formatBytes32 should be used in deploy javascript file. If my understanding is correct can I work on this issue?

pappas999 commented 2 years ago

Hi @shivam-agarwal-0 , thanks for much for volunteering to take on this PR. To action it successfully, you should change the variable in the solidity contract to be a bytes32 instead of a string, and then in any of the hardhat tasks or scripts that interact with the contract, you should use ethers.js library function like the one you specified to convert the string into a bytes32 to pass into the contract

0xshivamagarwal commented 2 years ago

Hey @pappas999 , I have opened a PR for this issue: #62 Please review and let me know if anything needs to be changed