关于从固体转移和批准功能
实际上,我需要使用以下功能“转换”和“批准”的功能非常简单的智能合约。
我只需要一份智能合约,如果用户调用“批准”功能,就可以要求批准从钱包中花费令牌(例如 - 烘烤)。
如果ONWER调用“转移”函数,它还可以从用户钱包中提取特定令牌从用户的钱包到“地址”。
I actually need a very simple smart contract using the following functions "transferfrom" and "approve".
I just need a smart contract that will be able to request approval to spend a token ( example -- bake ) from a wallet if the user calls the "approve" function.
It will also be able to withdraw the particular token from the user's wallet to the "address to" set by the contract's onwer, if the onwer calls the "transferfrom" function.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
erc20 标准不允许通过介于两者之间的合同中批准的标准。
用户始终需要直接在令牌合同上调用
anderve()
函数 - 而不是通过您的合同。There's a design limitation of the ERC20 standard that disallows approval through a contract in between.
The user always needs to invoke the
approve()
function on the token contract directly - not through your contract.