Sending less than 1 ether to verified smart contract.

huangapple go评论48阅读模式
英文:

Sending less than 1 ether to verified smart contract

问题

我正在尝试创建一个可支付的函数,允许发送小于1以太的金额。在Remix中,我可以选择Wei/Gwei/Ether,它可以正常工作,但当我在Etherscan上验证我的合同时,它只允许我输入以太为单位的值(图片)。是否可以将最小单位更改为Wei?

function Stake() public payable {
    _mint(msg.sender, msg.value);     
}

来自Etherscan的截图

尝试使用新的uint变量,但我只需要一个。

英文:

I am trying to make payable function that allows to send amount less than 1 ether. And it works in Remix where I can choose Wei/Gwei/Ether but when I verify my contract on Etherscan it allows me to enter a value only in ether (picture). Is it possible to change the minimum unit to wei?

`    function Stake() public payable {
         _mint(msg.sender, msg.value);     
     }`

screenshot from etherscan

Tried to use new uint variable but I need only one

答案1

得分: 1

你可以在Etherscan UI中输入十进制数字 - 例如 0.01

英文:

You can input decimal numbers in the Etherscan UI - for example 0.01.

huangapple
  • 本文由 发表于 2023年5月17日 21:30:09
  • 转载请务必保留本文链接:https://go.coder-hub.com/76272672.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定