dsa-connectors/contracts/common/stores.sol

44 lines
1.1 KiB
Solidity
Raw Normal View History

2021-02-07 15:31:36 +00:00
pragma solidity ^0.7.0;
2021-02-07 15:31:36 +00:00
import { MemoryInterface } from "./interfaces.sol";
2021-02-05 18:33:49 +00:00
abstract 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
}
2021-02-05 17:07:07 +00:00
/**
* @dev Return InstaDApp Mapping Addresses
*/
function getMappingAddr() internal pure returns (address) {
return 0xe81F70Cc7C0D46e12d70efc60607F16bbD617E88; // InstaMapping 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);
}
}