如何在部署在织机中的智能契约中接收其他令牌并将其保存在托管中?这是代码。
pragma solidity ^0.5.0;
//import ERC20 functionality ...
contract Example {
ERC20 public token;
//@param _token the address of the DAI smart contract
constructor(ERC20 _token) public {
token = ERC20(_token);
}
function () external payable {}
function getBalance() public view returns (uint256) {
return token.balanceOf(address(this));
}
function withdraw() public {
token.transfer(msg.sender, getBalance());
}
}
Ethereum中的逻辑是可以将钱保存在智能契约地址中,并在满足条件时释放它。我是否可以直接在织机网络中使用此代码,或者需要在传输网关中进行任何配置?如果不涉及传输网关,织机网络中的智能合同将如何处理?https://loomx.io/developers/en/extdev-transfer-gateway.html
发布于 2020-01-24 06:41:41
Loom与EVM兼容,因此您可能可以按原样部署合同。有关如何部署到Extdev Testnet:https://loomx.io/developers/en/deploy-loom-testnet.html的快速概述,请参阅本页
传输网关用于在链之间传输令牌,这是另一回事。这里有关于在Rinkeby和Extdev:https://loomx.io/developers/en/extdev-transfer-gateway.html之间转移资产的详细信息。
https://ethereum.stackexchange.com/questions/79288
复制相似问题