I am developing a DApp on the Kovan Network on Remix and I am having trouble understanding the problem. I am tring to call the Wrapped Ether contract (WETH : https://kovan.etherscan.io/address/0xd0a1e359811322d97991e03f863a0c30c2cf029c) from my own contract (to automaticly wrap / unwrap the ether my users deposit).
When I'm calling the contract from Etherscan through Metamask, I can deposit and withdraw WETH without any problem.
However the problem arise when I try to 'deposit' (with my wrapETH function) then 'withdraw' WETH through my contract. I realised the problem when my Withdraw attempts were always reverted. I realised that the deposit transaction was always pending on Remix, although the transaction was mined on its etherscan page (for example : https://kovan.etherscan.io/tx/0xe815da928878318b9e8eff18eb8ae353ebc0e8db9cd8fb2b39ca2b55f13d06f9), and that I could see the Event and check my balance on the WETH page.. The transaction itself also didn't appear on the WETH page. Another strange thing on this pending transaction is the 'input data' which is unreadable comparing with other transactions.
Does someone know what is happening, and why there is a difference between calling the WETH contract from Etherscan (again, where the transaction is mined and recorded directly) and not from my contract?
Here's the functions I'm calling (with only the useful)
WETH9_ WETHContract = WETH9_(0xd0a1e359811322d97991e03f863a0c30c2cf029c);
function depositETH() public payable{
}
function wrapETH(uint256 _amount) public{
WETHContract.deposit.value(_amount)();
}
function withdrawETH(uint256 _amount) public{
WETHContract.withdraw(_amount);
}
Thank you