aave-protocol-v2/specs/harness/UserConfigurationHarness.sol

57 lines
1.6 KiB
Solidity
Raw Normal View History

2020-11-20 10:45:20 +00:00
pragma solidity 0.6.12;
2020-10-14 21:59:12 +00:00
pragma experimental ABIEncoderV2;
import {UserConfiguration} from '../../contracts/libraries/configuration/UserConfiguration.sol';
2020-10-14 21:59:12 +00:00
/*
A wrapper contract for calling functions from the library UserConfiguration.
*/
contract UserConfigurationHarness {
2020-11-24 15:17:27 +00:00
DataTypes.UserConfigurationMap internal usersConfig;
function setBorrowing(
address user,
uint256 reserveIndex,
bool borrowing
) public {
UserConfiguration.setBorrowing(usersConfig, reserveIndex, borrowing);
}
function setUsingAsCollateral(
address user,
uint256 reserveIndex,
bool _usingAsCollateral
) public {
UserConfiguration.setUsingAsCollateral(usersConfig, reserveIndex, _usingAsCollateral);
}
function isUsingAsCollateralOrBorrowing(address user, uint256 reserveIndex)
public
2020-10-14 21:59:12 +00:00
view
returns (bool)
{
return UserConfiguration.isUsingAsCollateralOrBorrowing(usersConfig, reserveIndex);
}
2020-10-14 21:59:12 +00:00
function isBorrowing(address user, uint256 reserveIndex) public view returns (bool) {
return UserConfiguration.isBorrowing(usersConfig, reserveIndex);
}
2020-10-14 21:59:12 +00:00
function isUsingAsCollateral(address user, uint256 reserveIndex) public view returns (bool) {
return UserConfiguration.isUsingAsCollateral(usersConfig, reserveIndex);
}
2020-10-14 21:59:12 +00:00
function isBorrowingAny(address user) public view returns (bool) {
return UserConfiguration.isBorrowingAny(usersConfig);
}
2020-10-14 21:59:12 +00:00
function isEmpty(address user) public view returns (bool) {
return UserConfiguration.isEmpty(usersConfig);
}
/*
2020-10-14 21:59:12 +00:00
Mimics the original constructor of the contract.
*/
function init_state() public {}
2020-10-14 21:59:12 +00:00
}