Skip to content

Commit

Permalink
Merge pull request #28 from BibliothecaDAO/lords-burner-admin-execute
Browse files Browse the repository at this point in the history
burner: allow admin execute calls
  • Loading branch information
ponderingdemocritus authored Dec 14, 2024
2 parents 6f9121d + c77ca6c commit b8240e4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
13 changes: 12 additions & 1 deletion veLords/src/burner.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@

#[starknet::contract]
mod burner {
use lordship::interfaces::IBurner::IBurner;
use lordship::interfaces::IBurner::{IBurner, IBurnerAdmin};
use lordship::interfaces::IERC20::{IERC20Dispatcher, IERC20DispatcherTrait};
use lordship::interfaces::IRewardPool::{IRewardPoolDispatcher, IRewardPoolDispatcherTrait};
use openzeppelin::access::ownable::OwnableComponent;
use openzeppelin::account::utils::execute_calls;
use openzeppelin::upgrades::UpgradeableComponent;
use openzeppelin::upgrades::interface::IUpgradeable;
use starknet::account::Call;

use starknet::{ClassHash, ContractAddress, get_contract_address, contract_address_const};

component!(path: OwnableComponent, storage: ownable, event: OwnableEvent);
Expand Down Expand Up @@ -76,4 +79,12 @@ mod burner {
reward_pool.burn(lords_balance);
}
}

#[abi(embed_v0)]
impl IBurnerAdminImpl of IBurnerAdmin<ContractState> {
fn execute_calls(ref self: ContractState, mut calls: Array<Call>) -> Array<Span<felt252>> {
self.ownable.assert_only_owner();
execute_calls(calls)
}
}
}
6 changes: 6 additions & 0 deletions veLords/src/interfaces/IBurner.cairo
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
use starknet::ContractAddress;
use starknet::account::Call;

#[starknet::interface]
pub trait IBurner<TContractState> {
fn burn_lords(ref self: TContractState);
}

#[starknet::interface]
pub trait IBurnerAdmin<TContractState> {
fn execute_calls(ref self: TContractState, calls: Array<Call>) -> Array<Span<felt252>>;
}

0 comments on commit b8240e4

Please sign in to comment.