This contract's source code is verified! Compiler
0.7.6+commit.7338295f
File 1 of 2: IZkSync.sol
pragma solidity ^0.7.0;
interface IZkSync {
event WithdrawalPending(uint16 indexed tokenId, address indexed recepient, uint128 amount);
event WithdrawalNFTPending(uint32 indexed tokenId);
function withdrawPendingBalance(
address payable _owner,
address _token,
uint128 _amount
) external;
function withdrawPendingNFTBalance(uint32 _tokenId) external;
function getPendingBalance(address _address, address _token)
external
view
returns (uint128);
}
File 2 of 2: PendingBalanceWithdrawer.sol
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
import "./interfaces/IZkSync.sol";
contract PendingBalanceWithdrawer {
IZkSync constant zkSync = IZkSync(0xaBEA9132b05A70803a4E85094fD0e1800777fBEF);
struct RequestWithdrawFT {
address payable owner;
address token;
uint256 gas;
}
struct RequestWithdrawNFT {
uint32 tokenId;
uint256 gas;
}
function withdrawPendingBalances(RequestWithdrawFT[] calldata _FTRequests, RequestWithdrawNFT[] calldata _NFTRequests)
external
{
for (uint256 i = 0; i < _FTRequests.length; ++i) {
try
zkSync.withdrawPendingBalance{gas: _FTRequests[i].gas}(
_FTRequests[i].owner,
_FTRequests[i].token,
type(uint128).max
)
{} catch {}
}
for (uint256 i = 0; i < _NFTRequests.length; ++i) {
try
zkSync.withdrawPendingNFTBalance{gas: _NFTRequests[i].gas}(
_NFTRequests[i].tokenId
)
{} catch {}
}
}
}
{
"compilationTarget": {
"cache/solpp-generated-contracts/PendingBalanceWithdrawer.sol": "PendingBalanceWithdrawer"
},
"evmVersion": "istanbul",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
[{"inputs":[{"components":[{"internalType":"address payable","name":"owner","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"gas","type":"uint256"}],"internalType":"struct PendingBalanceWithdrawer.RequestWithdrawFT[]","name":"_FTRequests","type":"tuple[]"},{"components":[{"internalType":"uint32","name":"tokenId","type":"uint32"},{"internalType":"uint256","name":"gas","type":"uint256"}],"internalType":"struct PendingBalanceWithdrawer.RequestWithdrawNFT[]","name":"_NFTRequests","type":"tuple[]"}],"name":"withdrawPendingBalances","outputs":[],"stateMutability":"nonpayable","type":"function"}]