this is a simple contract. where I want to develop a function, optimizer
, upon calling it will transfer an amount of eth to an address. but when I deploy it on the testnet, connect my Metamask and try to call the optimizer function with 0.5 eth in Remix, its gives me this error:
transact to AB.Optimizer errored: Error encoding arguments: Error: invalid BigNumber string (argument="value", value="0.5", code=INVALID_ARGUMENT)
where is fault in my code?
pragma solidity ^0.8.7;
// SPDX-License-Identifier: GPL-3.0
contract ABc {
address payable b= payable(xxx);
uint amount= 0.4 ether;
function Optimizer( uint256 _amount )public payable{
_amount=msg.value;
require(amount >=0.4 ether,"transfer amount to low");
b.transfer(msg.value);
}
}