2021-04-01 10:02:46 +00:00
|
|
|
pragma solidity ^0.7.0;
|
|
|
|
|
|
|
|
import { MemoryInterface } from "./interfaces.sol";
|
|
|
|
|
|
|
|
|
|
|
|
abstract contract Stores {
|
|
|
|
|
|
|
|
/**
|
2021-04-07 23:45:00 +00:00
|
|
|
* @dev Return matic address
|
2021-04-01 10:02:46 +00:00
|
|
|
*/
|
2021-04-07 23:45:00 +00:00
|
|
|
address constant internal maticAddr = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
|
2021-04-01 10:02:46 +00:00
|
|
|
|
|
|
|
/**
|
2021-04-07 23:45:00 +00:00
|
|
|
* @dev Return Wrapped MATIC address
|
2021-04-01 10:02:46 +00:00
|
|
|
*/
|
2021-04-07 23:45:00 +00:00
|
|
|
address constant internal wmaticAddr = 0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270;
|
2021-04-01 10:02:46 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dev Return memory variable address
|
|
|
|
*/
|
2021-04-07 23:45:00 +00:00
|
|
|
MemoryInterface constant internal instaMemory = MemoryInterface(address(0)); // TODO: memory address on Polygon
|
2021-04-01 10:02:46 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dev Get Uint value from InstaMemory Contract.
|
|
|
|
*/
|
|
|
|
function getUint(uint getId, uint val) internal returns (uint returnVal) {
|
|
|
|
returnVal = getId == 0 ? val : instaMemory.getUint(getId);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @dev Set Uint value in InstaMemory Contract.
|
|
|
|
*/
|
|
|
|
function setUint(uint setId, uint val) virtual internal {
|
|
|
|
if (setId != 0) instaMemory.setUint(setId, val);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|