Skip to content

Commit

Permalink
playground tbr minting (#248) (#250)
Browse files Browse the repository at this point in the history
(cherry picked from commit 8eeed20)

Co-authored-by: tkernell <[email protected]>
  • Loading branch information
github-actions[bot] and tkernell authored Aug 2, 2024
1 parent 8568d56 commit 294aaf2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 3 additions & 1 deletion evm/contracts/testing/SimpleLayerUser.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ contract SimpleLayerUser {
uint256 aggregatePower;
uint256 previousTimestamp;
uint256 nextTimestamp;
uint256 relayTimestamp;
}

constructor(address _blobstreamO, bytes32 _queryId) {
Expand All @@ -34,7 +35,8 @@ contract SimpleLayerUser {
_attestData.attestationTimestamp,
_attestData.report.aggregatePower,
_attestData.report.previousTimestamp,
_attestData.report.nextTimestamp
_attestData.report.nextTimestamp,
block.timestamp
)
);
}
Expand Down
13 changes: 12 additions & 1 deletion evm/contracts/testing/TellorPlayground.sol
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ contract TellorPlayground {
uint8 private _decimals;
address public oracleMintRecipient;
uint256 public lastReleaseTimeDao;
address public deployer;

// Structs
struct StakeInfo {
Expand All @@ -63,6 +64,7 @@ contract TellorPlayground {
_decimals = 18;
token = address(this);
lastReleaseTimeDao = block.timestamp;
deployer = msg.sender;
}

/**
Expand Down Expand Up @@ -144,8 +146,16 @@ contract TellorPlayground {
uint256 _releasedAmount = (146.94 ether *
(block.timestamp - lastReleaseTimeDao)) /
86400;
_mint(oracleMintRecipient, _releasedAmount);
lastReleaseTimeDao = block.timestamp;
uint256 _stakingRewards = (_releasedAmount * 2) / 100;
_mint(oracleMintRecipient, _releasedAmount - _stakingRewards);
_mint(address(this), _stakingRewards);
_allowances[address(this)][
oracleMintRecipient
] = _stakingRewards;
TellorPlayground(oracleMintRecipient).addStakingRewards(
_stakingRewards
);
}

/**
Expand All @@ -169,6 +179,7 @@ contract TellorPlayground {
* @param _oracle The new oracle mint recipient
*/
function setOracleMintRecipient(address _oracle) external {
require(msg.sender == deployer, "only deployer can set oracle mint recipient");
oracleMintRecipient = _oracle;
}

Expand Down

0 comments on commit 294aaf2

Please sign in to comment.