Comments (2)
@AlexCheema This is an interesting issue you've uncovered.
The problem is not a missing topic exactly. Only indexed parameters are topics.
You call an ERC721 contract. The interface defines the Transfer event as follows.
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
Your ERC721 contract then calls an ERC20 contract which creates a Transfer event with signature:
event Transfer(address indexed from, address indexed to, uint256 value);
These are two separate events. Normally, the fact that each event has its own signature, would mean the log created by the called contract would not have a matching signature, and it would be treated as an anonymous event. This is the correct and expected behaviour in this case. However, both of these events have their signature derived from the standardised signature format resulting in Transfer(address,address,uint256)
, and thus their signatures match.
The client code then attempts to parse the ERC20 Transfer event as a ERC721 Transfer event, and a topic is missing because the ERC20 event does not have an indexed value
.
I think you are incorrectly expecting a log event of one type to be exposed as another type. The best you can hope for here is an anonymous event, otherwise you would end up with a value
in a tokenId
.
Regardless, there does seem to be a library issue in that it is parsing an event from one contract as if it belongs to another. I believe the solution is check that any returned logs belong to the current contract and if not they must be treated anonymous.
I will try and fix this shortly.
from web3x.
@AlexCheema v3.0.3 should fix your problem
Given the test case above, you will find that there are no events because TransferBug
does not generate any events. The raw event log generated by the ERC20 token call will be in a field named anonymousLogs
.
Hope this solves your problem.
from web3x.
Related Issues (20)
- Make typescript a runtime dependency HOT 10
- Document supported JS engines HOT 2
- Re-license to MIT HOT 3
- eth.getAccounts returns wrong type HOT 1
- Unclear how to unlock when required. HOT 4
- eth.personal.sign() + Metamask error HOT 2
- Problems with personal_unlockAccount HOT 2
- Cannot `call()`. HOT 2
- Detecting Network ID / Account changes.
- Why does `ContractEntryDefinition` does not fit what webx-codegen outputs ? HOT 3
- Not having `call` for transaction method is a mistake. HOT 3
- Number returns are seen as string instead of BN. HOT 4
- provider.on("connect
- `Legacy providers only support notification event.` when using `WebsocketProvider` HOT 5
- Why checking for outputs to define if a function is constant ? HOT 4
- internalType (Solidity 0.5.11+) with web3x-codegen - TS errors with ABI TS files HOT 3
- Import declaration conflicts with local declaration of 'Arrayish'. HOT 1
- new metamask update breaks getReceipt
- Expose Contract options HOT 3
- Incorrect import of dependency 'uuid'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from web3x.