링키비 테스트넷에 NFT 컨트랙트를 배포후 자바스크립트(Node.js)로 mint 메소드를 실행시킬수 있는 기능을 구현중입니다.
const tx = {
'from':ownerPublicKey,
'to':testContractAddress,
'gasLimit':500000,
'data':testContract.methods.mint(recipient, tokenUri).encodeABI()
};
const signedTx = await web3.eth.accounts.signTransaction(tx, ownerPrivateKey);
위와 같이 gasLimit 데이터를 하드코딩했는데... 이렇게 하드코딩해도 되는지 조언부탁드립니다.
이더스캔으로 확인하니 gasUsed 는 128,740로 떨어지는데.. 메인넷에서도 똑같은 사용량을 가진다라고 봐야 할까요?
그리고 gasPrice 데이터도 추가하고 싶은데... web3.eth.getGasPrice()를 통해 얻은 값을 그대로 넣어주면 될 지도 궁금하네요. ㅠㅠ