2022-03-22 15:24:40 +00:00
|
|
|
//SPDX-License-Identifier: MIT
|
2021-02-07 15:31:36 +00:00
|
|
|
pragma solidity ^0.7.0;
|
2020-11-20 14:49:48 +00:00
|
|
|
|
2021-02-07 17:31:30 +00:00
|
|
|
import { MemoryInterface, InstaMapping } from "./interfaces.sol";
|
2020-11-20 14:49:48 +00:00
|
|
|
|
|
|
|
|
2021-02-05 18:33:49 +00:00
|
|
|
abstract contract Stores {
|
|
|
|
|
2020-11-20 14:49:48 +00:00
|
|
|
/**
|
|
|
|
* @dev Return ethereum address
|
|
|
|
*/
|
2021-02-07 17:31:30 +00:00
|
|
|
address constant internal ethAddr = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
|
2020-11-20 14:49:48 +00:00
|
|
|
|
2021-02-08 14:31:55 +00:00
|
|
|
/**
|
|
|
|
* @dev Return Wrapped ETH address
|
|
|
|
*/
|
|
|
|
address constant internal wethAddr = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
|
|
|
|
|
2020-11-20 14:49:48 +00:00
|
|
|
/**
|
|
|
|
* @dev Return memory variable address
|
|
|
|
*/
|
2021-02-07 17:31:30 +00:00
|
|
|
MemoryInterface constant internal instaMemory = MemoryInterface(0x8a5419CfC711B2343c17a6ABf4B2bAFaBb06957F);
|
2020-11-20 14:49:48 +00:00
|
|
|
|
2021-02-05 17:07:07 +00:00
|
|
|
/**
|
|
|
|
* @dev Return InstaDApp Mapping Addresses
|
|
|
|
*/
|
2021-02-07 17:31:30 +00:00
|
|
|
InstaMapping constant internal instaMapping = InstaMapping(0xe81F70Cc7C0D46e12d70efc60607F16bbD617E88);
|
2021-02-05 17:07:07 +00:00
|
|
|
|
2020-11-20 14:49:48 +00:00
|
|
|
/**
|
|
|
|
* @dev Get Uint value from InstaMemory Contract.
|
|
|
|
*/
|
|
|
|
function getUint(uint getId, uint val) internal returns (uint returnVal) {
|
2021-02-07 17:31:30 +00:00
|
|
|
returnVal = getId == 0 ? val : instaMemory.getUint(getId);
|
2020-11-20 14:49:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @dev Set Uint value in InstaMemory Contract.
|
|
|
|
*/
|
|
|
|
function setUint(uint setId, uint val) virtual internal {
|
2021-02-07 17:31:30 +00:00
|
|
|
if (setId != 0) instaMemory.setUint(setId, val);
|
2020-11-20 14:49:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|