Skip to content

Commit 4fa4504

Browse files
committed
(feat) (openai/gpt-5.5, reviewed T, tested T) add proof-of-merge task vault
1 parent eb7ac59 commit 4fa4504

4 files changed

Lines changed: 822 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// SPDX-License-Identifier: Apache-2.0
2+
pragma solidity ^0.8.24;
3+
4+
import {Script} from "forge-std/Script.sol";
5+
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
6+
import {IJwtVerifier} from "../src/IJwtVerifier.sol";
7+
import {TaskVault} from "../src/TaskVault.sol";
8+
9+
contract DeployTaskVault is Script {
10+
/**
11+
* @notice Deploys TaskVault with configured RIK/JWT verifier addresses.
12+
*
13+
* Requirements:
14+
*
15+
* - `PRIVATE_KEY`, `RIK_ADDRESS`, and `JWT_VERIFIER_ADDRESS` must be set.
16+
*/
17+
function run() external returns (TaskVault vault) {
18+
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
19+
address rikAddress = vm.envAddress("RIK_ADDRESS");
20+
address jwtVerifierAddress = vm.envAddress("JWT_VERIFIER_ADDRESS");
21+
22+
vm.startBroadcast(deployerPrivateKey);
23+
vault = new TaskVault(IERC721(rikAddress), IJwtVerifier(jwtVerifierAddress));
24+
vm.stopBroadcast();
25+
}
26+
}

contracts/src/IJwtVerifier.sol

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// SPDX-License-Identifier: Apache-2.0
2+
pragma solidity ^0.8.24;
3+
4+
/**
5+
* @title IJwtVerifier
6+
* @notice Minimal verifier boundary for GitHub Actions OIDC JWTs.
7+
*/
8+
interface IJwtVerifier {
9+
/**
10+
* @notice Verifies a GitHub OIDC JWT and returns the decoded payload.
11+
*
12+
* @dev Implementations are expected to revert when `kid` is inactive, the RSA signature is invalid,
13+
* the issuer is wrong, or the JWT is outside its active time window.
14+
*
15+
* Requirements:
16+
*
17+
* - `kid` must identify an active GitHub Actions signing key.
18+
* - `signature` must be valid for `headerB64.payloadB64`.
19+
* - The decoded payload must be a currently valid GitHub Actions OIDC payload.
20+
*/
21+
function verifyGithubOidc(
22+
bytes32 kid,
23+
bytes calldata headerB64,
24+
bytes calldata payloadB64,
25+
bytes calldata signature
26+
) external view returns (bytes memory payload);
27+
}

0 commit comments

Comments
 (0)