文件 1 的 3:Context.sol
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
文件 2 的 3:ElasticVaultAPRTracker.sol
pragma solidity 0.8.9;
import "Ownable.sol";
contract ElasticVaultAPRTracker is Ownable {
struct RebaseData {
uint256 oldAMPLSupply;
uint256 newAMPLSupply;
uint256 amplVaultBalance;
uint256 ohmEEFILPVaultBalance;
uint256 estimated30DayAmplStakerApr;
uint256 estimated30DayOHMEEFILpApr;
uint256 time;
}
RebaseData[] public rebaseDataList;
function addRebaseData(RebaseData calldata _rebaseData) public onlyOwner {
rebaseDataList.push(_rebaseData);
}
function getAllRebaseData() public view returns (RebaseData[] memory) {
return rebaseDataList;
}
}
文件 3 的 3:Ownable.sol
pragma solidity ^0.8.0;
import "Context.sol";
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
modifier onlyOwner() {
_checkOwner();
_;
}
function owner() public view virtual returns (address) {
return _owner;
}
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
{
"compilationTarget": {
"ElasticVaultAPRTracker.sol": "ElasticVaultAPRTracker"
},
"evmVersion": "istanbul",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"components":[{"internalType":"uint256","name":"oldAMPLSupply","type":"uint256"},{"internalType":"uint256","name":"newAMPLSupply","type":"uint256"},{"internalType":"uint256","name":"amplVaultBalance","type":"uint256"},{"internalType":"uint256","name":"ohmEEFILPVaultBalance","type":"uint256"},{"internalType":"uint256","name":"estimated30DayAmplStakerApr","type":"uint256"},{"internalType":"uint256","name":"estimated30DayOHMEEFILpApr","type":"uint256"},{"internalType":"uint256","name":"time","type":"uint256"}],"internalType":"struct ElasticVaultAPRTracker.RebaseData","name":"_rebaseData","type":"tuple"}],"name":"addRebaseData","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAllRebaseData","outputs":[{"components":[{"internalType":"uint256","name":"oldAMPLSupply","type":"uint256"},{"internalType":"uint256","name":"newAMPLSupply","type":"uint256"},{"internalType":"uint256","name":"amplVaultBalance","type":"uint256"},{"internalType":"uint256","name":"ohmEEFILPVaultBalance","type":"uint256"},{"internalType":"uint256","name":"estimated30DayAmplStakerApr","type":"uint256"},{"internalType":"uint256","name":"estimated30DayOHMEEFILpApr","type":"uint256"},{"internalType":"uint256","name":"time","type":"uint256"}],"internalType":"struct ElasticVaultAPRTracker.RebaseData[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rebaseDataList","outputs":[{"internalType":"uint256","name":"oldAMPLSupply","type":"uint256"},{"internalType":"uint256","name":"newAMPLSupply","type":"uint256"},{"internalType":"uint256","name":"amplVaultBalance","type":"uint256"},{"internalType":"uint256","name":"ohmEEFILPVaultBalance","type":"uint256"},{"internalType":"uint256","name":"estimated30DayAmplStakerApr","type":"uint256"},{"internalType":"uint256","name":"estimated30DayOHMEEFILpApr","type":"uint256"},{"internalType":"uint256","name":"time","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]