mirror of
https://github.com/Instadapp/dsa-connectors-old.git
synced 2024-07-29 22:47:46 +00:00
Added oneInch Mapping contract
This commit is contained in:
parent
7c6bc47737
commit
ad235465e2
40
contracts/mapping/1inch.sol
Normal file
40
contracts/mapping/1inch.sol
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
pragma solidity ^0.6.0;
|
||||||
|
pragma experimental ABIEncoderV2;
|
||||||
|
|
||||||
|
interface IndexInterface {
|
||||||
|
function master() external view returns (address);
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ConnectorsInterface {
|
||||||
|
function chief(address) external view returns (bool);
|
||||||
|
}
|
||||||
|
|
||||||
|
contract Helpers {
|
||||||
|
|
||||||
|
event LogChangeOneProto(address oneProto);
|
||||||
|
|
||||||
|
address public constant connectors = 0xD6A602C01a023B98Ecfb29Df02FBA380d3B21E0c;
|
||||||
|
address public constant instaIndex = 0x2971AdFa57b20E5a416aE5a708A8655A9c74f723;
|
||||||
|
address public oneProtoAddress;
|
||||||
|
|
||||||
|
modifier isChief virtual {
|
||||||
|
require(
|
||||||
|
ConnectorsInterface(connectors).chief(msg.sender) ||
|
||||||
|
IndexInterface(instaIndex).master() == msg.sender, "not-Chief");
|
||||||
|
_;
|
||||||
|
}
|
||||||
|
|
||||||
|
function changeOneProtoAddress(address _oneProtoAddr) external isChief {
|
||||||
|
require(_oneProtoAddr != address(0), "oneProtoAddress-is-address(0)");
|
||||||
|
require(oneProtoAddress != _oneProtoAddr, "Same-oneProtoAddress");
|
||||||
|
|
||||||
|
oneProtoAddress = _oneProtoAddr;
|
||||||
|
emit LogChangeOneProto(_oneProtoAddr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
contract InstaOneMapping is Helpers {
|
||||||
|
constructor () public {
|
||||||
|
oneProtoAddress = 0x6cb2291A3c3794fcA0F5b6E34a8E6eA7933CA667;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user