this is a simple contract. where iI want to develop a function( optimizer), optimizer
, upon calling it will transfer an amount of eth to an address. but when iI deploy it on the testnet and, connect my metamaskMetamask and try to call the optimizer function with 0.5 eth(in remix) 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?
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);
}
}
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);
}
}