Hello...
I would like to know how could I send ether or Wei securely from my contract as commission handling type. As a matter of fact that users must pay an additional fee, or operation fee each time they send tokens to each other. These amount of ether/wei sent by users during the execution of a payable function on the contract must go to a Wallet already created account Ethereum

current use
.transfer(1 ether)

for example when I deploy it with metamask and ganache with local compilation it doesn't work for me gives the following error:
code: -32603, message: "Internal JSON-RPC error tranfer metamask

Jul 31, 2020, 5:04 PM
You can make the transfer function payable, but the biggest issue you will face is that even if it is theoretically still erc20 compatible contract (assuming that's what you need) in practice it can't be traded normally and the token can't be traded in normal exchanges.
Jul 31, 2020, 5:09 PM
Friend, you could help me with an example.

Practically what I want is when the TransferCustomerToCustomer() function is executed the user pays a commission,
this is my smart contract.
te lo agradezco de corazón
Jul 31, 2020, 5:35 PM
Can't open that right now (on mobile) but you can make the function payable and then make sure the user submitted enough value with msg.value
Jul 31, 2020, 5:42 PM
ok lo intentare, I'm going to do it.
Jul 31, 2020, 5:50 PM

© 2024 Draquery.com All rights reserved.