openzeppelin-test-helpers icon indicating copy to clipboard operation
openzeppelin-test-helpers copied to clipboard

Add helper for getting a contract's creation transaction

Open nventuro opened this issue 6 years ago • 2 comments

Truffle contracts include a property with the hash of the transaction in which they were created, web3 contracts, on the other hand, don't provide this value.

We could find it by doing a simple binary search over all blocks, querying for the code stored at the contract's address.

This can then be used to implement expectEvent.inConstruction for non-Truffle contracts.

nventuro avatar Oct 04 '19 00:10 nventuro

I edited the issue to make it more general than only fixing expectEvent.inConstruction.

frangio avatar Oct 04 '19 15:10 frangio

Also, we don't really know yet if this will be feasible.

frangio avatar Oct 04 '19 15:10 frangio