Skip to content

Commit

Permalink
Configure beneficiary script
Browse files Browse the repository at this point in the history
  • Loading branch information
lykhonis committed Dec 12, 2023
1 parent 3bb4d3e commit 8c3fc66
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions scripts/page/PageName.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ contract Configure is Script {

function run() external {
address controller = vm.envAddress("PROFILE_CONTROLLER_ADDRESS");
address treasury = vm.envAddress("TREASURY_ADDRESS");
UniversalProfile profile = UniversalProfile(payable(vm.envAddress("PROFILE_ADDRESS")));
LSP6KeyManager keyManager = LSP6KeyManager(profile.owner());
PageName pageName = PageName(payable(vm.envAddress("CONTRACT_PAGE_NAME_ADDRESS")));
Expand All @@ -86,6 +87,19 @@ contract Configure is Script {
);
}

if (pageName.beneficiary() != treasury) {
vm.broadcast(controller);
keyManager.execute(
abi.encodeWithSelector(
profile.execute.selector,
OPERATION_0_CALL,
address(pageName),
0,
abi.encodeWithSelector(pageName.setBeneficiary.selector, treasury)
)
);
}

if (pageName.price() != PRICE) {
vm.broadcast(controller);
keyManager.execute(
Expand Down

0 comments on commit 8c3fc66

Please sign in to comment.