Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
158 commits
Select commit Hold shift + click to select a range
5439759
Options to evaluate
sunbreak1211 Dec 12, 2025
27bc5ce
Option 4
sunbreak1211 Dec 17, 2025
9e48b91
Rename directories
sunbreak1211 Dec 17, 2025
599a3f0
Fixes
sunbreak1211 Dec 18, 2025
a3e4b51
Role for option 4
sunbreak1211 Dec 18, 2025
acaedc0
Add timelock layer - wip
oldchili Jan 5, 2026
9e9dd0a
Added Timelock Intended Roles and Actors in README
oldchili Jan 5, 2026
a263a32
Fix comments and error strings
oldchili Jan 5, 2026
8082adc
Add comment, move id calc
oldchili Jan 5, 2026
ada5635
Keeper Job Changes
oldchili Jan 6, 2026
17d2e4b
Refactors
oldchili Jan 6, 2026
6ee9458
Changes
sunbreak1211 Jan 6, 2026
7f2a750
Remove old options
sunbreak1211 Jan 6, 2026
8b6278c
More renaming
sunbreak1211 Jan 6, 2026
c3615fa
Move hop and maxChange to state
sunbreak1211 Jan 6, 2026
861e520
Clean configurator
sunbreak1211 Jan 6, 2026
9fa5453
Rolling back some naming
sunbreak1211 Jan 7, 2026
ccd18e1
Roles embedded in State
sunbreak1211 Jan 7, 2026
95f083f
Minor changes
oldchili Jan 8, 2026
ba9084b
Merge remote-tracking branch 'origin/dev' into timelock
oldchili Jan 8, 2026
c734527
Align to BEAMState
oldchili Jan 8, 2026
2430c40
Add grove alm controller functions
oldchili Jan 8, 2026
3db9f30
Add dss-test dependency
sunbreak1211 Jan 8, 2026
ff2ec2c
Remove addInitControllerActions with key
sunbreak1211 Jan 8, 2026
705ab2c
Unit tests for State
sunbreak1211 Jan 8, 2026
0d66c59
nit change
sunbreak1211 Jan 9, 2026
18145a4
Add comment to apply fix
sunbreak1211 Jan 9, 2026
6a3c764
Add Configurator unit tests
sunbreak1211 Jan 9, 2026
d39ec4a
Fix unlimited conditional in getInitRateLimits
sunbreak1211 Jan 9, 2026
138c0d3
Decouple pauCBeams mapping in two for controllers and rateLimits
sunbreak1211 Jan 9, 2026
07a56c0
Flip order some functions
sunbreak1211 Jan 9, 2026
d29008f
Add event for callControllerAction
sunbreak1211 Jan 9, 2026
7c0f288
Add whitelisting for rateLimits and controllers
sunbreak1211 Jan 12, 2026
88adf6b
Add stopped functionality
sunbreak1211 Jan 12, 2026
1550215
Roles.md
sunbreak1211 Jan 12, 2026
09d8ce0
Merge from dev and remove immediate functions
oldchili Jan 13, 2026
c2a1845
Minor Change
oldchili Jan 13, 2026
92f55cf
File renamings
oldchili Jan 13, 2026
1fde3f0
Remove comments
oldchili Jan 13, 2026
c952fa7
Style changes and notes
oldchili Jan 13, 2026
e60b6b8
README.md -> ROLES-TIMELOCK.md
oldchili Jan 13, 2026
4be40c7
Pause to block also cancelling
oldchili Jan 13, 2026
0e8b66e
Remove Timelock test until ready
oldchili Jan 13, 2026
73981af
Remove unused variable in test
sunbreak1211 Jan 13, 2026
da28bc3
Minor fixes
sunbreak1211 Jan 15, 2026
58acb55
Update CI tests file
sunbreak1211 Jan 15, 2026
a6d012c
Align functions and order to the linked controllers
oldchili Jan 15, 2026
3b45f50
Handle small comments
oldchili Jan 15, 2026
afd992e
Update src/timelock/TimelockWrapper.sol
oldchili Jan 15, 2026
996eff8
Add maxIterations and tests
oldchili Jan 16, 2026
22ed346
Change visibility function
sunbreak1211 Jan 16, 2026
8b10cef
Simplify Timelock constructor
sunbreak1211 Jan 16, 2026
05bd0cc
Fix license in files
sunbreak1211 Jan 16, 2026
4b431c3
Add deploy scripts + some integration tests
sunbreak1211 Jan 16, 2026
083e977
Fix typo in test
sunbreak1211 Jan 16, 2026
a7108d1
TimelockWrapper integration testing - wip
oldchili Jan 18, 2026
27217b6
Align wrapper and tests to actual releases currently use (v1.8.0)
oldchili Jan 19, 2026
76618f8
Minor changes
oldchili Jan 19, 2026
753f8d6
Minor changes to wrapper test
oldchili Jan 19, 2026
2c42435
Fetch proposals data in wrapper test
oldchili Jan 19, 2026
33c603c
getNextExecutableOperation pagination
oldchili Jan 19, 2026
24ba943
Add getOperationIndex, remove nextIndex return param
oldchili Jan 20, 2026
cefd7ab
public => external
oldchili Jan 20, 2026
cbf0907
Redeploy on constructor test, standarize modifiers test
oldchili Jan 20, 2026
cedd4c0
Minor changes
oldchili Jan 20, 2026
af35491
Avoid loading full struct in getNextExecutableOperation
oldchili Jan 20, 2026
5c59047
memory => calldata
oldchili Jan 20, 2026
06e2e54
Use maxIterations >= remaining
oldchili Jan 21, 2026
717bef9
Remove unneeded id storing, rename test
oldchili Jan 21, 2026
ea3f4ba
Fix CI + Use some real contracts in the Integration test
sunbreak1211 Jan 21, 2026
01aa916
Minor fixes
sunbreak1211 Jan 21, 2026
395bbc7
Add comments
sunbreak1211 Jan 21, 2026
f13d85d
Add keys to chainlog
sunbreak1211 Jan 21, 2026
895bafd
Fix solidity version to 0.8.24
sunbreak1211 Jan 21, 2026
b49cead
Remove TimelockKeeperJob as will be in dss-cron
oldchili Jan 22, 2026
dfb6e4b
Add missing getNext* tests for 100% coverage
oldchili Jan 22, 2026
7fbf258
Fix conditional
sunbreak1211 Jan 22, 2026
4c18ff7
Revert when passing different params to setRateLimit and default is u…
sunbreak1211 Jan 22, 2026
fd7ed09
Use enum for roles
sunbreak1211 Jan 22, 2026
37f1a7c
Reorder some tests
sunbreak1211 Jan 22, 2026
ae5803c
Minor state test changes
sunbreak1211 Jan 22, 2026
fb87759
Fix some configurator tests
sunbreak1211 Jan 22, 2026
24a07f8
More configurator tests changes
sunbreak1211 Jan 22, 2026
72ff9f7
Small comment addition
oldchili Jan 23, 2026
b7514b9
Addr README
oldchili Jan 23, 2026
c4d8dd1
Remove ROLES.md and ROLES-TIMELOCK.md
oldchili Jan 23, 2026
4441134
Remove unnecessary things from configurator test
sunbreak1211 Jan 23, 2026
b23f152
Add TimelockWrapperForeign (untested)
oldchili Jan 26, 2026
e6cbf6a
Merge pull request #2 from sky-ecosystem/mom
oldchili Jan 26, 2026
895df02
Simplify Configurator.setRateLimit making it a bit more restrictive a…
sunbreak1211 Jan 26, 2026
bb27eff
Add comment
sunbreak1211 Jan 26, 2026
f8486ef
Split deployment and init of Mom and TimelockWrapper to separate func…
sunbreak1211 Jan 27, 2026
3c3cfdb
Merge remote-tracking branch 'origin/dev' into foreign-wrapper
oldchili Jan 27, 2026
55c6aa2
Add deploy function and test for foreign wrapper
oldchili Jan 27, 2026
9a7fc5d
Add L2PASSpell
oldchili Jan 27, 2026
e3a5c19
Minor changes
sunbreak1211 Jan 27, 2026
9ef53d6
CI: fix base rpc url
sunbreak1211 Jan 27, 2026
57c67c2
Remove specific block from rpc tests
sunbreak1211 Jan 27, 2026
82a8b10
Merge branch 'dev' into foreign-wrapper
sunbreak1211 Jan 27, 2026
287c461
Remove specific block from rpc tests
sunbreak1211 Jan 27, 2026
4e46251
Reorder function in TimelockWrapper and fix comments
sunbreak1211 Jan 27, 2026
cc3a937
Rename TimelockWrapper to TimelockWrapperMainnet
sunbreak1211 Jan 27, 2026
40fba65
Rollback rename in PASInit and simplify some tests variable name
sunbreak1211 Jan 27, 2026
94ee8f9
Merge branch 'dev' into foreign-wrapper
sunbreak1211 Jan 27, 2026
255ed5f
Apply suggestions from code review
oldchili Jan 28, 2026
a04909e
Alignments of mainnet and foreign wrappers
oldchili Jan 28, 2026
91b76ed
Remove unused events
sunbreak1211 Jan 28, 2026
e366d31
Merge pull request #3 from sky-ecosystem/foreign-wrapper
oldchili Jan 28, 2026
95a5ab6
Change l2 spell pragma to ^0.8.24
oldchili Jan 28, 2026
d83d0a7
nit change
sunbreak1211 Jan 28, 2026
5fcf1e4
Add more checks to Wrappers tests and some other minor changes
sunbreak1211 Jan 28, 2026
d2e97a8
Add note about initial capacity for a new key
oldchili Jan 29, 2026
fbada47
Add foreign wrapper to readme
oldchili Jan 29, 2026
c695084
Add rationale for blocking cancel on pause
oldchili Jan 29, 2026
d25a4c3
Make mappings to be internal
oldchili Jan 29, 2026
9785b1e
Add variables for keys
sunbreak1211 Jan 29, 2026
e33ad80
Add init function for extras that can also be set by core council via…
sunbreak1211 Jan 29, 2026
c05692d
Make setting hop mandatory for increments
sunbreak1211 Jan 29, 2026
0795aba
Add comment about immediate vs delayed actions
oldchili Jan 30, 2026
1a43da0
Remove comment
sunbreak1211 Jan 30, 2026
b090cc8
Add comment about EnumerableSet order
oldchili Jan 30, 2026
e89295a
Timelock: Replace helper structure from enumerable to linked list (#5)
sunbreak1211 Feb 6, 2026
358954b
Bump Spark mainnet alm controller version to v1.9
oldchili Feb 6, 2026
296651a
Update README to the relocation of getNextExecutableOperationId
oldchili Feb 6, 2026
588d053
Timelock: minor changes
sunbreak1211 Feb 5, 2026
047c8a5
Linked list: return false instead of reverting when adding bytes32(0)…
sunbreak1211 Feb 6, 2026
53f05f4
Fix comment
sunbreak1211 Feb 6, 2026
9863519
State: Fix some minor inconsistencies
sunbreak1211 Feb 6, 2026
3142e72
nit change
sunbreak1211 Feb 6, 2026
3ef03a1
Change order params of a couple of functions of wrappers
sunbreak1211 Feb 7, 2026
581a448
Add SECURITY.md (#6)
oldchili Feb 7, 2026
1ee9431
Add defensive requires on linked list calls
oldchili Feb 7, 2026
652f369
Minor import path change
oldchili Feb 7, 2026
43326ee
Remove comment about cancelers
oldchili Feb 8, 2026
8993949
Update src/timelock/Bytes32LinkedList.sol
oldchili Feb 8, 2026
e95eda4
Remove unused constant in PASInit
sunbreak1211 Feb 8, 2026
4fab3aa
Remove some misleading comments
sunbreak1211 Feb 8, 2026
207ef97
Wrappers: use abi.encodeCall
sunbreak1211 Feb 13, 2026
bd5505f
Allow to decrease from unlimited if the state is updated
sunbreak1211 Feb 13, 2026
610ba4e
Comments about checking in general if no specific setting
oldchili Feb 15, 2026
26f0645
Add comment about enforcing maximal rate limits
oldchili Feb 15, 2026
2af76dd
Fix in test
sunbreak1211 Feb 16, 2026
8ea679a
Add also overflow protection for slope
sunbreak1211 Feb 16, 2026
94be5f0
Minor changes
sunbreak1211 Feb 16, 2026
027ea6d
Minor changes
sunbreak1211 Feb 17, 2026
0645289
Merge pull request #8 from sky-ecosystem/audit-changes
sunbreak1211 Feb 19, 2026
189efd7
Fix README heading
oldchili Feb 23, 2026
edef24b
Add audit reports (#9)
sunbreak1211 Feb 23, 2026
914de30
Add LICENSE
sunbreak1211 Feb 26, 2026
30fddbf
Add initLimitsAndControllerData
oldchili Mar 6, 2026
905cc21
Add setCbeams calls to initExtras (#11)
oldchili Apr 30, 2026
0a7e2b6
Add audit reports
oldchili Jul 7, 2026
6284e96
Merge pull request #10 from sky-ecosystem/init-data-in-spell
oldchili Jul 7, 2026
fdadb33
Remove Wrappers (#12)
oldchili Jul 10, 2026
78d771d
Add PASAuthorizeInPAU Lib and Option to Start Paused (#13)
oldchili Jul 20, 2026
efd0492
Add clarification that the admin is not a pauser
oldchili Jul 23, 2026
f499088
Add note about unlimited rate limits
oldchili Jul 27, 2026
947e71c
Add protection to existing unlimited rate limit keys to not be mistak…
sunbreak1211 Aug 4, 2026
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
37 changes: 18 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,37 @@
name: CI
name: test

permissions: {}

on:
push:
pull_request:
workflow_dispatch:
on: [push, pull_request]

env:
FOUNDRY_PROFILE: ci

jobs:
check:
strategy:
fail-fast: true

name: Foundry project
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v3
with:
persist-credentials: false
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Show Forge version
run: forge --version

- name: Run Forge fmt
run: forge fmt --check
with:
version: stable

- name: Run Forge build
run: forge build --sizes
run: |
forge --version
forge build --sizes
id: build

- name: Run Forge tests
run: forge test -vvv
run: |
forge test -vvv
id: test
env:
ETH_RPC_URL : ${{ secrets.ETH_RPC_URL }}
BASE_RPC_URL: ${{ secrets.BASE_RPC_URL }}
7 changes: 7 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
[submodule "lib/dss-test"]
path = lib/dss-test
url = https://github.com/sky-ecosystem/dss-test

661 changes: 661 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# PAS - Parallelized Allocation System

PAS is a governance framework for managing rate-limited operations through authorized actors called cBeams. It provides timelocked proposal execution, configurable rate limits, and role-based access control for interacting with external controllers.

## Contracts

### BeamState

Central registry that manages system configuration and access control. Stores which cBeams are authorized to operate on which rate limit contracts and controllers, defines default rate limits and allowed controller actions, and configures parameters like `hop` (minimum time between increases) and `maxChange` (maximum rate of change). Supports role-based permissions with actions split between timelocked and direct access.

### Configurator

The operational interface used by cBeams to modify rate limits and execute controller actions. Enforces that rate limit changes respect the configured ceilings and requires waiting for `hop` between increases. Also gates controller calls through pre-approved action hashes stored in BeamState.

### Timelock

Extended OpenZeppelin TimelockController with pausing support, permissionless execution, and operation tracking for keeper integration. Disables self-calls to prevent proposals from modifying admin settings.

### PASMom

Emergency governance contract that allows authorized parties to trigger circuit breakers. Can call `stop()` on BeamState to halt Configurator operations and `pause()` on Timelock to block scheduling and execution. Callable by the owner or via the Chief's hat through the authority.

## Unlimited rate limits

A rate limit key is treated as unlimited — the Configurator forces any cBeam call to keep it at `(max, 0)` and rejects any attempt to lower it — in either of these cases:

- It is registered in BeamState as `(max, 0)` (via `addInitRateLimits`), or
- It is currently `(max, 0)` in RateLimits and has no BeamState default for that key.

The second case protects keys that are already unlimited (e.g. withdrawal keys kept unlimited for security) even when they were never registered: a cBeam cannot unilateraly reset such a key to `0`. This holds both when first enabling the Configurator on an already-active PAU and when later opting into a facet that adds such a key.

To make an existing unlimited key adjustable by a cBeam (e.g. to bound it), a `roleAuth` caller must register a bounded default for it via `addInitRateLimits` (through a star spell or the Timelock, depending on how the action is routed); the key then follows the normal bounded-limit rules.
Note that the bounded default must be nonzero in at least one field as (0, 0) is indistinguishable from an unregistered key.

**Warning:** unlocking a protected unlimited key (by registering a bounded default) hands control of it to the cBeam — which can then set it to any value down to `0`, immediately. Treat it as a deliberate governance decision: use a **key-rateLimits** specific default (never the general `address(0)` slot, which applies to that key across all RateLimits contracts), and only for keys you intend to make cBeam-adjustable.
22 changes: 22 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Notes and Trust Assumptions

- The following entities are trusted:
- **Timelock**: Fully trusted.
- **Core Council through direct actions**: Very highly trusted.
- **cBEAMs**: Mostly trusted (a trusted team's multisig, malicious activity is assumed to be of very low likelihood).

- It is assumed proposers or cancelers would not cancel proposals maliciously (including Core Council).
- It is assumed that before adding calldata, rate limits, or whitelisting targets, security related scenarios are thoroughly considered.
- As part of the above considerations, possible misalignment of cBEAMs is expected to be taken into consideration (although unlikely). For example:
1. Omission - not executing a call when expected
2. Double execution - executing the same call twice
3. Stale execution - executing an old call after a newer one superseded it
4. Reordering - executing calls in the wrong order
- It is also expected to be considered whether cBEAMs can block withdrawals in case of emergencies (for example, when needed, infinity rate limit would be configured).
- It is assumed the Core Council would not block withdrawals or emergency mechanisms on purpose.
- It is expected to be considered whether a default rate limits / calldata can be applied simultaneously on many controllers, thus amplifying potential harm. For example, the damage of depositing into a new vault without applying slippage protection might be amplified if it can be done for all whitelisted controllers. In general it is assumed that as the system scales more protections are added for such scenarios.
- It is assumed that cBEAMs and Core Council are synced in their operations, including timing their actions against Timelock executions.
- It is assumed the cancelers and Core Council are available on short notice to remove proposals and configurations if needed. This includes removing old calldata/rate-limits in a timely manner.
- It is assumed pausers would not temporarily DoS the timelock on purpose.
- As with other Sky contracts, a mom mechanism is not expected to be deployed on remote chains. It is expected to be sufficiently replaced with highly secured and trusted multisigs.

Binary file added audit/20260219-cantina-report-sky-pas.pdf
Binary file not shown.
Binary file added audit/20260506-ChainSecurity_Sky_PAS_audit.pdf
Binary file not shown.
Binary file added audit/20260521-cantina-report-sky-pas.pdf
Binary file not shown.
53 changes: 53 additions & 0 deletions deploy/L2PASSpell.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// SPDX-FileCopyrightText: © 2026 Dai Foundation <www.daifoundation.org>
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

pragma solidity ^0.8.24;

import { PASInit } from "./PASInit.sol";
import { PASInstance } from "./PASInstance.sol";

// An L2 spell template for L2GovernanceRelay to initialize PAS contracts on a foreign chain.
// This spell should be viewed as skeleton/sample and can be altered prior to being used
// if further configurations are needed (for example adding more proposers).
contract L2PASSpell {

address public immutable beamState;
address public immutable configurator;
address public immutable timelock;

constructor(address beamState_, address configurator_, address timelock_) {
beamState = beamState_;
configurator = configurator_;
timelock = timelock_;
}

function init(
uint256 minDelay,
address coreCouncil,
address[] memory cancellers,
address[] memory pausers,
bool startPaused
) external {
PASInstance memory pas = PASInstance({
beamState: beamState,
configurator: configurator,
timelock: timelock
});

PASInit.init(pas, minDelay, coreCouncil, cancellers, pausers);
if (startPaused) PASInit.pauseTimelock(timelock, address(this));
}
}
51 changes: 51 additions & 0 deletions deploy/PASAuthorizeInPAU.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// SPDX-FileCopyrightText: © 2026 Dai Foundation <www.daifoundation.org>
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

pragma solidity >=0.8.0;

interface AccessControlLike {
function grantRole(bytes32 role, address account) external;
}

// Authorizes the PAS Configurator within a Star's PAU access-control system.
//
// Counterpart to PASInit: whereas PASInit configures the PAS-owned contracts (BeamState,
// Configurator, Timelock), this is run by a Star's governance (the current DEFAULT_ADMIN_ROLE
// holder on its PAU controller stack) to grant the PAS Configurator the admin access it needs
// on the Star's own contracts.
//
// The two grants cover everything the Configurator calls:
// - accessControls: gates every facet admin setter dispatched via `callControllerAction`
// (the controller has no roles of its own; it delegates to AccessControls).
// - rateLimits: gates `setRateLimit` (setRateLimitData / setUnlimitedRateLimitData).
//
// NOTE: DEFAULT_ADMIN_ROLE is the OZ role-admin, so each grant makes the Configurator a full
// role-superadmin of that contract (it can grant/revoke any role, including allocators). This
// is the intended trust model but has a wide blast radius; the security of these roles rests
// entirely on the timelock/cBeam/BeamState gating in front of the Configurator.
library PASAuthorizeInPAU {

bytes32 internal constant DEFAULT_ADMIN_ROLE = 0x00;

function authorize(
address configurator,
address accessControls,
address rateLimits
) internal {
AccessControlLike(accessControls).grantRole(DEFAULT_ADMIN_ROLE, configurator);
AccessControlLike(rateLimits).grantRole(DEFAULT_ADMIN_ROLE, configurator);
}
}
53 changes: 53 additions & 0 deletions deploy/PASDeploy.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// SPDX-FileCopyrightText: © 2026 Dai Foundation <www.daifoundation.org>
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

pragma solidity ^0.8.24;

import { ScriptTools } from "dss-test/ScriptTools.sol";
import { PASInstance } from "./PASInstance.sol";
import { BeamState } from "src/BeamState.sol";
import { Configurator } from "src/Configurator.sol";
import { Timelock } from "src/timelock/Timelock.sol";
import { PASMom } from "src/PASMom.sol";

library PASDeploy {

function deploy(
address deployer,
address owner,
uint256 minDelay
) internal returns (PASInstance memory pasInstance) {
pasInstance.beamState = address(new BeamState());
pasInstance.configurator = address(new Configurator(pasInstance.beamState));
pasInstance.timelock = address(new Timelock(
minDelay,
owner
));
ScriptTools.switchOwner(pasInstance.beamState, deployer, owner);
}

function deployMom(
address owner,
address beamState,
address timelock
) internal returns (address mom) {
mom = address(new PASMom(
beamState,
timelock
));
PASMom(mom).setOwner(owner);
}
}
Loading
Loading