Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cache manager #200

Merged
merged 4 commits into from
Jul 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
35 changes: 30 additions & 5 deletions scripts/deploymentUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ import {
bytecode as UpgradeExecutorBytecode,
} from '@offchainlabs/upgrade-executor/build/contracts/src/UpgradeExecutor.sol/UpgradeExecutor.json'
import { Toolkit4844 } from '../test/contract/toolkit4844'
import { ArbOwner__factory, ArbSys__factory } from '../build/types'
import {
ArbOwner__factory,
ArbSys__factory,
CacheManager__factory,
} from '../build/types'

const INIT_CACHE_SIZE = 536870912
const INIT_DECAY = 10322197911
Expand Down Expand Up @@ -244,20 +248,41 @@ export async function deployAndSetCacheManager(
chainOwnerWallet: any,
verify: boolean = true
) {
const cacheManager = await deployContract(
const cacheManagerLogic = await deployContract(
'CacheManager',
chainOwnerWallet,
[INIT_CACHE_SIZE, INIT_DECAY],
[],
verify
)

const proxyAdmin = await deployContract(
'ProxyAdmin',
chainOwnerWallet,
[],
verify
)

const cacheManagerProxy = await deployContract(
'TransparentUpgradeableProxy',
chainOwnerWallet,
[cacheManagerLogic.address, proxyAdmin.address, '0x'],
verify
)

const cacheManager = CacheManager__factory.connect(
cacheManagerProxy.address,
chainOwnerWallet
)

await (await cacheManager.initialize(INIT_CACHE_SIZE, INIT_DECAY)).wait()

const arbOwner = ArbOwner__factory.connect(
ARB_OWNER_ADDRESS,
chainOwnerWallet
)
await (await arbOwner.addWasmCacheManager(cacheManager.address)).wait()
await (await arbOwner.addWasmCacheManager(cacheManagerProxy.address)).wait()

return cacheManager
return cacheManagerProxy
}

// Check if we're deploying to an Arbitrum chain
Expand Down
2 changes: 1 addition & 1 deletion slither.db.json

Large diffs are not rendered by default.

Loading