fixing 1inch compile issue;

added curve_testing.sol and got it compiled;
This commit is contained in:
Lecky Lao 2020-08-16 02:08:35 +10:00
parent cd427e96f6
commit 010ecfa776
3 changed files with 57 additions and 3 deletions

View File

@ -74,7 +74,7 @@ contract OneHelpers is Stores, DSMath {
/**
* @dev Return 1proto Address
*/
function getOneProtoAddress() internal view returns (address payable) {
function getOneProtoAddress() virtual internal view returns (address payable) {
return payable(OneProtoMappingInterface(getOneProtoMappingAddress()).oneProtoAddress());
}
@ -642,4 +642,4 @@ contract OneInch is OneProto {
contract ConnectOne is OneInch {
string public name = "1inch-1proto-v1";
}
}

View File

@ -0,0 +1,54 @@
pragma solidity ^0.6.0;
// import files from common directory
import { Stores } from "../common/stores.sol";
import { DSMath } from "../common/math.sol";
import { TokenInterface } from "../common/interfaces.sol";
interface ICurve {
function claim(address addr) external;
}
contract CurveVestingHelpers is Stores, DSMath{
/**
* @dev Return Curve Token Address
*/
function getCurveTokenAddr() internal pure returns (address) {
return 0xD533a949740bb3306d119CC777fa900bA034cd52;
}
/**
* @dev Return Curve Vesting Address
*/
function getCurveVestingAddr() internal pure returns (address) {
return 0x575CCD8e2D300e2377B43478339E364000318E2c;
}
}
contract CurveVestingProtocol is CurveVestingHelpers {
event LogClaim(address sender, uint256 claimable, uint256 getId, uint256 setId);
/**
* @dev Claim Curve DAO Token.
* @param sender address of the sender.
* @param getId Get token amount at this ID from `InstaMemory` Contract.
* @param setId Set token amount at this ID in `InstaMemory` Contract.
*/
function claim(address sender, uint getId, uint setId) external{
TokenInterface curveTokenContract = TokenInterface(getCurveTokenAddr());
uint initialCurveBal = curveTokenContract.balanceOf(address(this));
ICurve(getCurveVestingAddr()).claim(address(this));
uint finalCurveBal = curveTokenContract.balanceOf(address(this));
uint claimedAmt = sub(finalCurveBal, initialCurveBal);
setUint(setId, claimedAmt);
emit LogClaim(address(this), claimedAmt, getId, setId);
bytes32 _eventCode = keccak256("LogClaim(address,uint256,uint256,uint256)");
bytes memory _eventParam = abi.encode(address(this), claimedAmt, getId, setId);
emitEvent(_eventCode, _eventParam);
}
}

View File

@ -1,7 +1,7 @@
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
import { ConnectOne } from "../connectors/1proto.sol";
import { ConnectOne } from "../connectors/1inch.sol";
contract MockConnectOne is ConnectOne {
address public oneProtoAddr;