How to receive other tokens in the smart contract deployed in loom and keep it in escrow?, this is the code.
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());
}
}
Logic in Ethereum is one can keep the money in the smart contract address, and release it when conditions are met. Can I use this code directly in the loom network, or there needs to be any configuration done in the transfer gateway? How will the smart contract in loom network handle it if the transfer gateway is not involved. https://loomx.io/developers/en/extdev-transfer-gateway.html