- import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.4/contracts/token/ERC20/IERC20.sol";
- pragma solidity ^0.6.6;
- interface RootChainManagerProxy
- {
- function depositEtherFor(address user) external payable ;
- function depsoitFor(address user,address rootToken,bytes calldata depositData) external;
- }
- contract matic
- {
- uint256 amount = 100*(10**18);
- address tokenPredicate = 0xdD6596F2029e6233DEFfaCa316e6A95217d4Dc34;
- address token = 0x655F2166b0709cd575202630952D71E2bB0d61Af; //matic token
- RootChainManagerProxy rootChainManager = RootChainManagerProxy(0xBbD7cBFA79faee899Eaf900F13C9065bF03B1A74);
- IERC20 erc20 = IERC20(token);
- function depositERC20() external{
- erc20.approve(tokenPredicate,amount);
- bytes memory data = abi.encode("1000000000000000000");
- rootChainManager.depsoitFor(msg.sender,token, data);
- }
- function depositEther() public payable {
- rootChainManager.depositEtherFor{value:msg.value}(msg.sender);
- }
- }
[text] matic.sol
Viewer
*** This page was generated with the meta tag "noindex, nofollow". This happened because you selected this option before saving or the system detected it as spam. This means that this page will never get into the search engines and the search bot will not crawl it. There is nothing to worry about, you can still share it with anyone.
Editor
You can edit this paste and save as new: