dsa-connectors-old/contracts/common/stores.sol
Lecky Lao becd0135aa formating stores.sol;
fixing import for SafeERC20 and IERC20;
set up constructor for synthetix connector to set address for staking contract;
created MockSynthetix.sol for test;
added nomiclabs/buidler;
fixed test for SynthetixProtocol.js;
adding .gitatributes to highlight solidity on GitHub;
adding buidler artefacts and cache to git ignore;
adding buidler.config.js;
2020-07-12 02:04:48 +10:00

59 lines
1.5 KiB
Solidity

pragma solidity ^0.6.0;
import { MemoryInterface, EventInterface} from "./interfaces.sol";
contract Stores {
/**
* @dev Return ethereum address
*/
function getEthAddr() internal pure returns (address) {
return 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; // ETH Address
}
/**
* @dev Return memory variable address
*/
function getMemoryAddr() internal pure returns (address) {
return 0x8a5419CfC711B2343c17a6ABf4B2bAFaBb06957F; // InstaMemory Address
}
/**
* @dev Return InstaEvent Address.
*/
function getEventAddr() internal pure returns (address) {
return 0x2af7ea6Cb911035f3eb1ED895Cb6692C39ecbA97; // InstaEvent Address
}
/**
* @dev Get Uint value from InstaMemory Contract.
*/
function getUint(uint getId, uint val) internal returns (uint returnVal) {
returnVal = getId == 0 ? val : MemoryInterface(getMemoryAddr()).getUint(getId);
}
/**
* @dev Set Uint value in InstaMemory Contract.
*/
function setUint(uint setId, uint val) virtual internal {
if (setId != 0) MemoryInterface(getMemoryAddr()).setUint(setId, val);
}
/**
* @dev emit event on event contract
*/
function emitEvent(bytes32 eventCode, bytes memory eventData) virtual internal {
(uint model, uint id) = connectorID();
EventInterface(getEventAddr()).emitEvent(model, id, eventCode, eventData);
}
/**
* @dev Connector Details - needs to be changed before deployment
*/
function connectorID() public view returns(uint model, uint id) {
(model, id) = (0, 0);
}
}