Skip to content
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
17 changes: 7 additions & 10 deletions script/DeployRiseTestnet.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,21 @@ pragma solidity ^0.8.24;
import {Script} from "forge-std/Script.sol";
import {console2} from "forge-std/console2.sol";
import {Delveworn} from "../src/Delveworn.sol";
import {LegacyVRFAdapter} from "../src/adapters/LegacyVRFAdapter.sol";

/// @notice Deploys Delveworn on RISE Testnet behind the compatibility VRF adapter.
/// @dev RISE_VRF_COORDINATOR must point to the existing RISE VRF-style coordinator/provider contract.
/// @notice Deploys Delveworn directly against the RISE Testnet VRF coordinator.
/// @dev The RISE coordinator already satisfies Delveworn's provider-neutral randomness interface.
contract DeployRiseTestnet is Script {
function run() external returns (LegacyVRFAdapter adapter, Delveworn dungeon) {
address upstreamCoordinator = vm.envAddress("RISE_VRF_COORDINATOR");
require(upstreamCoordinator != address(0), "Invalid RISE VRF coordinator");
function run() external returns (Delveworn dungeon) {
address riseCoordinator = vm.envAddress("RISE_VRF_COORDINATOR");
require(riseCoordinator != address(0), "Invalid RISE VRF coordinator");

vm.startBroadcast();

adapter = new LegacyVRFAdapter(upstreamCoordinator);
dungeon = new Delveworn(address(adapter));
dungeon = new Delveworn(riseCoordinator);

vm.stopBroadcast();

console2.log("RISE upstream VRF coordinator:", upstreamCoordinator);
console2.log("LegacyVRFAdapter:", address(adapter));
console2.log("RISE VRF coordinator:", riseCoordinator);
console2.log("Delveworn:", address(dungeon));
}
}
9 changes: 5 additions & 4 deletions scripts/deploy-rise-testnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ echo "Reading its coordinator from $RPC_URL ..."
CURRENT_COORDINATOR="$(cast call "$CURRENT_DUNGEON" 'coordinator()(address)' --rpc-url "$RPC_URL")"
CURRENT_COORDINATOR="$(cast to-check-sum-address "$CURRENT_COORDINATOR")"

# A chain-agnostic Delveworn deployment may already point at a
# LegacyVRFAdapter. If so, reuse the actual provider-facing coordinator
# rather than stacking a second compatibility adapter on top of the first.
# A previous deployment may already point at a LegacyVRFAdapter. In that
# case, recover the provider-facing coordinator and deploy the new core
# directly against it. RISE currently fulfills direct consumers but did not
# fulfill requests routed through the extra adapter callback hop.
UPSTREAM_COORDINATOR="$(cast call "$CURRENT_COORDINATOR" 'upstreamCoordinator()(address)' --rpc-url "$RPC_URL" 2>/dev/null || true)"

if [[ -n "$UPSTREAM_COORDINATOR" ]]; then
Expand All @@ -40,7 +41,7 @@ fi

export RISE_VRF_COORDINATOR

echo "Deploying fresh LegacyVRFAdapter + Delveworn V2 ..."
echo "Deploying Delveworn V2 directly against the RISE VRF coordinator ..."

forge script script/DeployRiseTestnet.s.sol:DeployRiseTestnet \
--rpc-url "$RPC_URL" \
Expand Down