Support
Quality
Security
License
Reuse
kandi has reviewed metamask-extension and discovered the below as its top functions. This is intended to give you an instant insight into metamask-extension implemented functionality, and help decide if they suit your requirements.
:globe_with_meridians: :electric_plug: The MetaMask browser extension enables browsing Ethereum blockchain enabled websites
No Code Snippets are available at this moment for metamask-extension.
QUESTION
Metamask 'Contract Interaction' label for defined function?
Asked 2022-Mar-09 at 07:46Working with metamask, I have these two functions, which (for the most part) have almost identical calls to a smart contract:
localContract.methods
.presaleMint(window.ethereum.selectedAddress, ipfs)
.send({
from: window.ethereum.selectedAddress,
value: web3.utils.toWei(price * amount + "", "ether"),
gas: 240000 * (100 - amount * 4) / 100 * amount
})
localContract.methods.togglePresale().send({
from: window.ethereum.selectedAddress,
gas: 800000
})
The main difference I see is that the first function has params.
My question though is, why does metamask give the name of the called function for the second, but not the first? (first only shows 'Contract Interaction')
I can see that this was raised on metamask git years ago, i'm just surprised it's still set this way... https://github.com/MetaMask/metamask-extension/issues/8835
ANSWER
Answered 2022-Mar-09 at 07:46MetaMask uses a dictionary that translates function selector (0x
and the first 8 hex characters of the data
field) into a human-readable name.
If MM doesn't find the function selector in the dictionary, they use a generic label "Contract Interaction".
How to add your function selector (of the presaleMint()
function) to their dictionary: https://docs.metamask.io/guide/registering-function-names.html#verify
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
No vulnerabilities reported
Save this library and start creating your kit
Explore Related Topics
Save this library and start creating your kit