mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
feat: Replace non-available solidity instructions on OVM
This commit is contained in:
parent
7708bc6d2f
commit
72b5da643b
|
@ -1,6 +1,8 @@
|
||||||
// SPDX-License-Identifier: agpl-3.0
|
// SPDX-License-Identifier: agpl-3.0
|
||||||
pragma solidity 0.6.12;
|
pragma solidity 0.6.12;
|
||||||
|
|
||||||
|
import {IERC20} from './IERC20.sol';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dev Collection of functions related to the address type
|
* @dev Collection of functions related to the address type
|
||||||
*/
|
*/
|
||||||
|
@ -52,7 +54,9 @@ library Address {
|
||||||
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
|
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
|
||||||
*/
|
*/
|
||||||
function sendValue(address payable recipient, uint256 amount) internal {
|
function sendValue(address payable recipient, uint256 amount) internal {
|
||||||
require(address(this).balance >= amount, 'Address: insufficient balance');
|
// require(address(this).balance >= amount, 'Address: insufficient balance');
|
||||||
|
uint256 balance = IERC20(0x4200000000000000000000000000000000000006).balanceOf(address(this));
|
||||||
|
require(balance >= amount, 'Address: insufficient balance');
|
||||||
|
|
||||||
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
|
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
|
||||||
(bool success, ) = recipient.call{value: amount}('');
|
(bool success, ) = recipient.call{value: amount}('');
|
||||||
|
|
|
@ -43,7 +43,8 @@ contract WalletBalanceProvider {
|
||||||
**/
|
**/
|
||||||
function balanceOf(address user, address token) public view returns (uint256) {
|
function balanceOf(address user, address token) public view returns (uint256) {
|
||||||
if (token == MOCK_ETH_ADDRESS) {
|
if (token == MOCK_ETH_ADDRESS) {
|
||||||
return user.balance; // ETH balance
|
// return user.balance; // ETH balance
|
||||||
|
return IERC20(0x4200000000000000000000000000000000000006).balanceOf(user);
|
||||||
// check if token is actually a contract
|
// check if token is actually a contract
|
||||||
} else if (token.isContract()) {
|
} else if (token.isContract()) {
|
||||||
return IERC20(token).balanceOf(user);
|
return IERC20(token).balanceOf(user);
|
||||||
|
|
|
@ -3,6 +3,6 @@ pragma solidity 0.6.12;
|
||||||
|
|
||||||
contract SelfdestructTransfer {
|
contract SelfdestructTransfer {
|
||||||
function destroyAndTransfer(address payable to) external payable {
|
function destroyAndTransfer(address payable to) external payable {
|
||||||
selfdestruct(to);
|
// selfdestruct(to);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
|
|
||||||
pragma solidity >=0.4.22 <=0.6.12;
|
pragma solidity >=0.4.22 <=0.6.12;
|
||||||
|
|
||||||
|
import {IERC20} from '../../../dependencies/openzeppelin/contracts/IERC20.sol';
|
||||||
|
|
||||||
contract WETH9 {
|
contract WETH9 {
|
||||||
string public name = 'Wrapped Ether';
|
string public name = 'Wrapped Ether';
|
||||||
string public symbol = 'WETH';
|
string public symbol = 'WETH';
|
||||||
|
@ -45,7 +47,8 @@ contract WETH9 {
|
||||||
}
|
}
|
||||||
|
|
||||||
function totalSupply() public view returns (uint256) {
|
function totalSupply() public view returns (uint256) {
|
||||||
return address(this).balance;
|
// return address(this).balance;
|
||||||
|
return IERC20(0x4200000000000000000000000000000000000006).balanceOf(address(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
function approve(address guy, uint256 wad) public returns (bool) {
|
function approve(address guy, uint256 wad) public returns (bool) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user