1

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

1 Answer 1

0

Loom is EVM compatible so you can probably deploy the contract as is. Refer to this page for a quick overview on how to deploy to Extdev Testnet: https://loomx.io/developers/en/deploy-loom-testnet.html

Transfer gateway is used to transfer tokens between chains, it's a different thing. This has details about transferring assets between Rinkeby and Extdev: https://loomx.io/developers/en/extdev-transfer-gateway.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.