Skip to content

Commit

Permalink
Improve scripts
Browse files Browse the repository at this point in the history
Signed-off-by: Francesco <[email protected]>
  • Loading branch information
fulminmaxi committed Mar 14, 2024
1 parent 24346b3 commit c989196
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
3 changes: 2 additions & 1 deletion script/FloodPlain.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ contract FloodPlainScript is BetterScript {
}

function addDecoder(FloodPlain flood, address decoder) public {
vm.broadcast();
uint256 key = vm.envUint("ALT_ADMIN_KEY");
vm.broadcast(key);
uint256 id = flood.addDecoder(decoder);
console.log("Decoder", decoder, "added with id", id);
}
Expand Down
22 changes: 22 additions & 0 deletions script/Zone.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,26 @@ contract ZoneScript is BetterScript {
);
vm.stopBroadcast();
}

function authorize(Zone zone, address reader) public {
address zoneAdmin = vm.envAddress("ZONE_ADMIN_ADDRESS");
vm.startBroadcast(zoneAdmin);
IAuthZone.AddressFilter memory emptyAddressFilter = IAuthZone.AddressFilter({value: address(0), exclude: false});
IAuthZone.RangeFilter memory emptyRangeFilter = IAuthZone.RangeFilter({gte: 0, lte: 0});
IAuthZone.ItemFilter memory emptyItemFilter =
IAuthZone.ItemFilter({token: emptyAddressFilter, amount: emptyRangeFilter});
IAuthZone.ItemFilter[] memory emptyItemFilters;
zone.setAuthorizationFilter(
reader,
IAuthZone.AuthFilter({
initialized: true,
offerer: emptyAddressFilter,
offer: emptyItemFilters,
consideration: emptyItemFilter,
deadline: emptyRangeFilter,
nonce: emptyRangeFilter
})
);
vm.stopBroadcast();
}
}

0 comments on commit c989196

Please sign in to comment.