Running
const receipt = await contract.mint(4)
console.log(receipt)
gives me the following transaction receipt
{
hash: '0xee7c081488965518d3cb8d23a13a4eabf728a6f1842c9b1249679a8b809bcf29',
type: 2,
accessList: [],
blockHash: '0x741edbbc20aa711b80cbcbf6f7cf4ffed88bc042a4417ddbeb0b38d7fdf385cc',
blockNumber: 3,
transactionIndex: 0,
confirmations: 1,
from: '0x70997970C51812dc3A010C7d01b50e0d17dc79C8',
gasPrice: BigNumber { _hex: '0x65013202', _isBigNumber: true },
maxPriorityFeePerGas: BigNumber { _hex: '0x3b9aca00', _isBigNumber: true },
maxFeePerGas: BigNumber { _hex: '0x8e679a04', _isBigNumber: true },
gasLimit: BigNumber { _hex: '0x01bad518', _isBigNumber: true },
to: '0x5FbDB2315678afecb367f032d93F642f64180aa3',
value: BigNumber { _hex: '0x00', _isBigNumber: true },
nonce: 0,
data: '0xfe234aac0000000000000000000000000000000000000000000000000000000000000004',
r: '0xc0edd7dc1a026cddeee860ab6f7d1aacf80a0c3c9ef3a119a49382662a74f39d',
s: '0x3b1a06a0df530e153bd22852d5956e59dbcac0250eda1cdd961e71554027f60e',
v: 1,
creates: null,
chainId: 31337,
wait: [Function (anonymous)]
}
I want to run tests with waffle and would like to make sure that the refund is implemented correctly. For that I want to see if the account balance difference equals the transaction value minus the refund. The problem is that I now have to take gas costs into account. How do I accurately factor these out?