mirror of
https://github.com/Instadapp/dsa-resolvers-deprecated.git
synced 2024-07-29 22:38:16 +00:00
Added curve vesting resolver
This commit is contained in:
parent
f09f30a53b
commit
e5f51bab3c
52
contracts/protocols/curve_vesting.sol
Normal file
52
contracts/protocols/curve_vesting.sol
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
pragma solidity ^0.6.0;
|
||||||
|
|
||||||
|
interface TokenInterface {
|
||||||
|
function balanceOf(address) external view returns (uint);
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ICurveVesting {
|
||||||
|
function vestedOf(address addr) external view returns (uint256);
|
||||||
|
function balanceOf(address addr) external view returns (uint256);
|
||||||
|
function lockedOf(address addr) external view returns (uint256);
|
||||||
|
function total_claimed(address addr) external view returns (uint256);
|
||||||
|
}
|
||||||
|
|
||||||
|
contract CurveVestingHelpers {
|
||||||
|
/**
|
||||||
|
* @dev Return Curve Token Address
|
||||||
|
*/
|
||||||
|
function getCurveTokenAddr() virtual internal view returns (address) {
|
||||||
|
return 0xD533a949740bb3306d119CC777fa900bA034cd52;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @dev Return Curve Vesting Address
|
||||||
|
*/
|
||||||
|
function getCurveVestingAddr() virtual internal view returns (address) {
|
||||||
|
return 0x575CCD8e2D300e2377B43478339E364000318E2c;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
contract Resolver is CurveVestingHelpers {
|
||||||
|
function getPosition(address user) public view returns (
|
||||||
|
uint vestedBalance,
|
||||||
|
uint unclaimedBal,
|
||||||
|
uint claimedBal,
|
||||||
|
uint lockedBalance,
|
||||||
|
uint crvBalance
|
||||||
|
) {
|
||||||
|
ICurveVesting vestingContract = ICurveVesting(getCurveVestingAddr());
|
||||||
|
vestedBalance = vestingContract.vestedOf(user);
|
||||||
|
unclaimedBal = vestingContract.balanceOf(user);
|
||||||
|
claimedBal = vestingContract.total_claimed(user);
|
||||||
|
lockedBalance = vestingContract.lockedOf(user);
|
||||||
|
|
||||||
|
crvBalance = TokenInterface(getCurveTokenAddr()).balanceOf(user);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
contract InstaCurveVestingResolver is Resolver {
|
||||||
|
string public constant name = "Curve-Vesting-Resolver-v1";
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user