'Can not pass metadata with metamask deeplink
This is the deep-link:
ethereum:0xBaa11D872cfD22c4D9525E1011af790bB56d656E@1337?value=1e18&data=somedata
And this is the QR that is generated from the url above
i am not able to receive the metadata from payment receive event in solidity contract
this is the event log:
{
logIndex: 0,
transactionIndex: 0,
transactionHash: '0x8d504a1253f30bbc43c5212434dc7dc52a122afc2d08cf6e2c496e34fb316ecd',
blockHash: '0xcf91cdab48a97255c52532732fff9091a7ff5f371a6552f94aaac55a95fb42b1',
blockNumber: 33,
address: '0xBaa11D872cfD22c4D9525E1011af790bB56d656E',
type: 'mined',
id: 'log_8ce94ba5',
returnValues: Result {
'0': '0x49372600c1BD394922c0B6463611DeD4CbeDAf45',
'1': '1000000000000000000',
'2': null,
_from: '0x49372600c1BD394922c0B6463611DeD4CbeDAf45',
_amount: '1000000000000000000',
data: null
},
event: 'MoneyReceivedWithData',
signature: '0xf7d31a904a564a801af9dfae1796bd5fd339d215fedc9314fbfbcffb5c14f205',
raw: {
data: '0x0000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000',
topics: [
'0xf7d31a904a564a801af9dfae1796bd5fd339d215fedc9314fbfbcffb5c14f205',
'0x00000000000000000000000049372600c1bd394922c0b6463611ded4cbedaf45'
]
}
this is the solidity functions:
Event:
event MoneyReceived(address indexed _from, uint256 _amount);
Fallback function:
fallback() external payable {
emit MoneyReceived(msg.sender, msg.value);
}
and as you can see the "data" field in the "returnValues" field is null.
Please help. I found no way to pass a metadata to transaction via mobile metamask QR scan transfer (same as deep-link). I need to understand how to build a proper deep-link url to pass the necessary data to my solidity event-emiter or is it a way to pass a metadata as a parameter through deep-link.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
