From da990810844966f3841b41b31db696ae2961e701 Mon Sep 17 00:00:00 2001 From: Splidge Date: Thu, 26 Aug 2021 12:13:18 +0100 Subject: [PATCH] add a setter for treasury --- contracts/RCLeaderboard.sol | 14 ++++++++++++++ contracts/interfaces/IRCLeaderboard.sol | 2 ++ 2 files changed, 16 insertions(+) diff --git a/contracts/RCLeaderboard.sol b/contracts/RCLeaderboard.sol index 3e5ddb94..5aa8ba7f 100644 --- a/contracts/RCLeaderboard.sol +++ b/contracts/RCLeaderboard.sol @@ -18,6 +18,7 @@ contract RCLeaderboard is NativeMetaTransaction, IRCLeaderboard { // Contracts and Permissions IRCTreasury public override treasury; IRCMarket public override market; + bytes32 public constant UBER_OWNER = keccak256("UBER_OWNER"); bytes32 public constant MARKET = keccak256("MARKET"); bytes32 public constant FACTORY = keccak256("FACTORY"); @@ -59,6 +60,19 @@ contract RCLeaderboard is NativeMetaTransaction, IRCLeaderboard { _; } + /*╔═════════════════════════════════╗ + ║ GOVERNANCE ║ + ╚═════════════════════════════════╝*/ + + function setTreasuryAddress(address _newTreasury) external override { + require( + treasury.checkPermission(UBER_OWNER, msgSender()), + "Extremely Verboten" + ); + require(_newTreasury != address(0)); + treasury = IRCTreasury(_newTreasury); + } + /*╔═════════════════════════════════╗ ║ Leaderboard Tracking ║ ╚═════════════════════════════════╝*/ diff --git a/contracts/interfaces/IRCLeaderboard.sol b/contracts/interfaces/IRCLeaderboard.sol index 69aef34e..bb606841 100644 --- a/contracts/interfaces/IRCLeaderboard.sol +++ b/contracts/interfaces/IRCLeaderboard.sol @@ -11,6 +11,8 @@ interface IRCLeaderboard { function NFTsToAward(address _market) external view returns (uint256); + function setTreasuryAddress(address _newTreasury) external; + function updateLeaderboard( address _user, uint256 _card,