Send 1 ETH from contract to specific address

My contract will be holding ETH because I'm selling NFT's, but how do I transfer a specific amount to a specific wallet address?

wallet address and amount if fixed, amount);

create an external method that is only callable by you, pass wallet and amount as parameters and call transfer

Only callable by me, will not work, this needs to be done automatically when a user mints a NFT

then call walletAddress.transfer(amount) in the mint function



This throws an error: TypeError: "send" and "transfer" are only available for objects of type "address payable", not "address".

replace "address" with "payable":


payable() creates an object of type address payable. This is necessary since solidity 6.0.0 (source)

1 Like