Hi everyone. I try to undestand how to send money through smart contract :)
I want to create instant payment from payeer to receiver without storing money in smart contract and getting fee for service )
This function compiled in Solidity but when I try send 1 ETH I got error:
"Note: The called function should be payable if you send value and the value you send should be less than your current balance.
Debug the transaction to get more information."
_feeWallet is payable.
function sendThroughContract(address payable to, address assetAddress) public payable {
uint256 fee = msg.value / 100 * _feeCommission;
require(msg.sender.balance >= msg.value + fee, "not enough balance");
to.transfer(msg.value);
_feeWallet.transfer(fee);
}
Apr 5, 2022, 4:57 AM
Can someone help to make instant payment :)
Apr 5, 2022, 4:57 AM
msg.value is used when you are sending ethereum sir, it seems you are trying to send other crypto assets since you have provided the address of the token as an argument to the sendthrough smartcontract function, you should change 2 things 1./ add the amount of tokens you wish to send to the recipient allong with the recipinent address and contract address of token you want to send to the recipient to the paramenters of the function, then change requirement statement to require( token.ballanceOf(msg.sender)> amountSent); and use token.transferFrom(msg.sender, reciepient Address, amount)... also this means you have to request approval from the msg.sender for the amount to be transfered to the recipient address
some pple add all the contracts in one file—"flattening" and then verify their code as one file
may be a better approach
not an escrow contract
why not deploy an escrow contract with abitrators that can earn the fees
this is like saying customers should send funds to your personal wallets instead of the developers
or even launch a dao protocol for the jobs
that way the owners can ear passivelly from transactions that originate from here
will you grant me admin permisions lol
I can build it in a month from my free time
or the art work
or the minting applications?
I can build the smart contracts
and I have a good frontend developer that can develop the frontend of the minting application
send me a dm if you are interested in talking more
Apr 5, 2022, 6:13 AM