Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tweak: allow overriding #27

Open
wants to merge 1 commit into
base: feat/auth-ether-faucet
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions contracts/token/ERC20Rewards.sol
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ contract ERC20Rewards is AccessControl, ERC20Permit {
/// @dev Set a rewards token.
/// @notice Careful, this can only be done once.
function setRewardsToken(IERC20 rewardsToken_)
external
external virtual
auth
{
require(rewardsToken == IERC20(address(0)), "Rewards token already set");
Expand All @@ -68,7 +68,7 @@ contract ERC20Rewards is AccessControl, ERC20Permit {

/// @dev Set a rewards schedule
function setRewards(uint32 start, uint32 end, uint96 rate)
external
external virtual
auth
{
require(
Expand Down Expand Up @@ -167,7 +167,7 @@ contract ERC20Rewards is AccessControl, ERC20Permit {

/// @dev Claim all rewards from caller into a given address
function claim(address to)
external
external virtual
returns (uint256 claiming)
{
_updateRewardsPerToken();
Expand Down
2 changes: 1 addition & 1 deletion contracts/utils/AuthEtherFaucet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ contract AuthEtherFaucet is AccessControl {
receive() external payable {}

function drip(address payable to, uint256 amount)
external
external virtual
auth
{
(bool sent,) = to.call{value: amount}("");
Expand Down
10 changes: 5 additions & 5 deletions contracts/utils/EmergencyBrake.sol
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ contract EmergencyBrake is AccessControl, IEmergencyBrake {

/// @dev Register an access removal transaction
function plan(address target, Permission[] calldata permissions)
external override auth
external override virtual auth
returns (bytes32 txHash)
{
txHash = keccak256(abi.encode(target, permissions));
Expand All @@ -88,7 +88,7 @@ contract EmergencyBrake is AccessControl, IEmergencyBrake {

/// @dev Erase a planned access removal transaction
function cancel(bytes32 txHash)
external override auth
external override virtual auth
{
require(plans[txHash].state == State.PLANNED, "Emergency not planned for.");
delete plans[txHash];
Expand All @@ -97,7 +97,7 @@ contract EmergencyBrake is AccessControl, IEmergencyBrake {

/// @dev Execute an access removal transaction
function execute(bytes32 txHash)
external override auth
external override virtual auth
{
Plan memory plan_ = plans[txHash];
require(plan_.state == State.PLANNED, "Emergency not planned for.");
Expand All @@ -124,7 +124,7 @@ contract EmergencyBrake is AccessControl, IEmergencyBrake {

/// @dev Restore the orchestration from an isolated target
function restore(bytes32 txHash)
external override auth
external override virtual auth
{
Plan memory plan_ = plans[txHash];
require(plan_.state == State.EXECUTED, "Emergency plan not executed.");
Expand All @@ -145,7 +145,7 @@ contract EmergencyBrake is AccessControl, IEmergencyBrake {

/// @dev Remove the restoring option from an isolated target
function terminate(bytes32 txHash)
external override auth
external override virtual auth
{
require(plans[txHash].state == State.EXECUTED, "Emergency plan not executed.");
delete plans[txHash];
Expand Down
2 changes: 1 addition & 1 deletion contracts/utils/Relay.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ contract Relay is Ownable() {

/// @dev Execute a series of function calls
function execute(Call[] calldata functionCalls)
external onlyOwner returns (bytes[] memory results)
external virtual onlyOwner returns (bytes[] memory results)
{
results = new bytes[](functionCalls.length);
for (uint256 i = 0; i < functionCalls.length; i++){
Expand Down
10 changes: 5 additions & 5 deletions contracts/utils/Timelock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,15 @@ contract Timelock is ITimelock, AccessControl {

/// @dev Propose a transaction batch for execution
function propose(Call[] calldata functionCalls)
external override auth returns (bytes32 txHash)
external override virtual auth returns (bytes32 txHash)
{
return _propose(functionCalls, 0);
}

/// @dev Propose a transaction batch for execution, with other identical proposals existing
/// @param salt Unique identifier for the transaction when repeatedly proposed. Chosen by governor.
function proposeRepeated(Call[] calldata functionCalls, uint256 salt)
external override auth returns (bytes32 txHash)
external override virtual auth returns (bytes32 txHash)
{
return _propose(functionCalls, salt);
}
Expand All @@ -127,7 +127,7 @@ contract Timelock is ITimelock, AccessControl {

/// @dev Approve a proposal and set its eta
function approve(bytes32 txHash)
external override auth returns (uint32 eta)
external override virtual auth returns (uint32 eta)
{
Proposal memory proposal = proposals[txHash];
require(proposal.state == STATE.PROPOSED, "Not proposed.");
Expand All @@ -140,15 +140,15 @@ contract Timelock is ITimelock, AccessControl {

/// @dev Execute a proposal
function execute(Call[] calldata functionCalls)
external override auth returns (bytes[] memory results)
external override virtual auth returns (bytes[] memory results)
{
return _execute(functionCalls, 0);
}

/// @dev Execute a proposal, among several identical ones
/// @param salt Unique identifier for the transaction when repeatedly proposed. Chosen by governor.
function executeRepeated(Call[] calldata functionCalls, uint256 salt)
external override auth returns (bytes[] memory results)
external override virtual auth returns (bytes[] memory results)
{
return _execute(functionCalls, salt);
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@yield-protocol/utils-v2",
"version": "2.4.6",
"version": "2.4.7",
"description": "Yield v2 utility contracts",
"author": "Yield Inc.",
"files": [
Expand Down