Hi guys, Im a noob dev and couldnt find this on google. So I wonder about the payable functionality. From what I understood it does not work with wallets like tw or mm to open the transfer approval widget, this is only erc20 721 and 1155 right? Is it only possible to call payable stuff from a contract or a hardcoded script? There is no easy wallet connect front end solution for it right?
Jun 10, 2023, 1:46 PM
Mhm you got a confused idea about payable.
https://docs.alchemy.com/docs/solidity-payable-functions
https://docs.alchemy.com/docs/solidity-payable-functions
On the frontend you must be very careful with payable, expecially double checking the target contract or wallet address.
If you miss the contract address with a function, it's ok. You just waste gasFees and you will see "transfer*" on explorer.
With payable functions, money are gone
If you miss the contract address with a function, it's ok. You just waste gasFees and you will see "transfer*" on explorer.
With payable functions, money are gone
Jun 10, 2023, 1:49 PM
What i mean is, they cant be called from a wallet via wallet connect on a web app, correct? This is erc20 stuff?
Jun 10, 2023, 1:49 PM
This is evm stuff
Erc20 is a design standard to represent a fungible token
And yes, they can be called from a wallet on a dapp
When you buy tokens on uniswap with eth, you're using a payable function
Jun 10, 2023, 1:50 PM
So if I connect a wallet to a web app and have a button to pay 1 ether with a payable function for whatever, it will open up trust wallet to confirm the tx?
Thank you, thats cool, means I can go more individual as a dev not using all of these standards
Jun 10, 2023, 1:53 PM
Nono you want to use the standards
On blickchains the rule "if ain't broken don't change it" is a necessary evil.
That's why you see a lot of forks around
That's why you see a lot of forks around
If a code works, it's been audited and it's accepted by lot of dapps, you want probably to use it
You can play around with the logics, but if you want to develop a token, you must use erc20 design, otherwise it's a special contract that must be handled in a different manner by users and your dapp
Jun 10, 2023, 1:55 PM
Yeah I has special contracts in mind
*had
Buying a token via ether but not one intended for tw, swaps, etc. only use case would be in the dapp
Jun 10, 2023, 1:57 PM
you can still make cool things respecting the popular standards like 20,721,1155
they give you more support and adoption
Jun 10, 2023, 1:58 PM
Yeah it's also a good idea to have the possibilities that they bring with them
Well many thanks for the help! :)
Jun 10, 2023, 2:06 PM