-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDeployWebAuthn256r1.s.sol
51 lines (40 loc) · 2.39 KB
/
DeployWebAuthn256r1.s.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.19 <0.9.0;
import { BaseScript } from "./BaseScript.s.sol";
import { WebAuthnWrapper } from "test/WebAuthnWrapper.sol";
/// @notice This script deploys the ECDSA256r1 library
contract DeployScript is BaseScript {
function run() external broadcast returns (address addr) {
// deploy the library contract and return the address
addr = address(new WebAuthnWrapper());
}
}
/*
ℹ️ HOW TO USE THIS SCRIPT USING A LEDGER:
forge script script/DeployWebAuthn256r1.s.sol:DeployScript --rpc-url <RPC_URL> --ledger --sender <ACCOUNT_ADDRESS> \
[--broadcast]
ℹ️ HOW TO USE THIS SCRIPT WITH AN ARBITRARY PRIVATE KEY (NOT RECOMMENDED):
PRIVATE_KEY=<PRIVATE_KEY> forge script script/DeployWebAuthn256r1.s.sol:DeployScript --rpc-url <RPC_URL> [--broadcast]
ℹ️ HOW TO USE THIS SCRIPT ON ANVIL IN DEFAULT MODE:
forge script script/DeployWebAuthn256r1.s.sol:DeployScript --rpc-url http://127.0.0.1:8545 --broadcast --sender \
0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --mnemonics "test test test test test test test test test test test junk"
ℹ️ HOW TO CALL THE LIBRARY ONCE DEPLOYED:
cast call <CONTRACT_ADDRESS> verify(bytes,bytes1,bytes,bytes32,uint256,uint256,uint256,uint256,uint256)(bool)" \
<AUTH_DATA_FLAGMASK> <AUTH_DATA> <CLIENT_DATA> <CLIENT_CHALLENGE> <CLIENT_CHALLENGE_OFFSET> \
<R> <S> <QX> <QY>
example:
cast call 0x387ca8d38f379710a3d24d710ba2940787f7b4a1 \
"verify(bytes1,bytes,bytes,bytes,uint256,uint256,uint256,uint256,uint256)(bool)" \
0x01 \
0xf8e4b678e1c62f7355266eaa4dc1148573440937063a46d848da1e25babbd20b010000004d \
0x7b2274797065223a22776562617574686e2e676574222c226368616c6c656e67\
65223a224e546f2d3161424547526e78786a6d6b61544865687972444e583369\
7a6c7169316f776d4f643955474a30222c226f726967696e223a226874747073\
3a2f2f66726573682e6c65646765722e636f6d222c2263726f73734f726967696e223a66616c73657d\
353a3ed5a0441919f1c639a46931de872ac3357de2ce5aa2d68c2639df54189d \
0x24 \
45847212378479006099766816358861726414873720355505495069909394794949093093607 \
55835259151215769394881684156457977412783812617123006733908193526332337539398 \
114874632398302156264159990279427641021947882640101801130664833947273521181002 \
32136952818958550240756825111900051564117520891182470183735244184006536587423
*/