Skip to content

Commit

Permalink
finish website
Browse files Browse the repository at this point in the history
  • Loading branch information
nalinbhardwaj committed Oct 8, 2023
1 parent 4e81813 commit 02f8b40
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 37 deletions.
49 changes: 49 additions & 0 deletions broadcast/Deploy.s.sol/1/run-latest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"transactions": [
{
"hash": "0xbc5be668ab62069f5ac227c23a8b8fd85dd95c3754f7faddb8330048192adf88",
"transactionType": "CREATE2",
"contractName": "P256Verifier",
"contractAddress": "0xc2b78104907F722DABAc4C69f826a522B2754De4",
"function": null,
"arguments": null,
"transaction": {
"type": "0x02",
"from": "0x9a57d792cc04a7bceb5d1f8b1b7af5f8e5695e54",
"to": "0x4e59b44847b379578588920ca78fbf26c0b4956c",
"gas": "0x122af0",
"value": "0x0",
"data": "0x00000000000000000000000000000000000000000000000000000000000000006080806040523461001657610dd1908161001c8239f35b600080fdfe60e06040523461001a57610012366100c7565b602081519101f35b600080fd5b6040810190811067ffffffffffffffff82111761003b57604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60e0810190811067ffffffffffffffff82111761003b57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761003b57604052565b60a08103610193578060201161001a57600060409180831161018f578060601161018f578060801161018f5760a01161018c57815182810181811067ffffffffffffffff82111761015f579061013291845260603581526080356020820152833560203584356101ab565b15610156575060ff6001915b5191166020820152602081526101538161001f565b90565b60ff909161013e565b6024837f4e487b710000000000000000000000000000000000000000000000000000000081526041600452fd5b80fd5b5080fd5b5060405160006020820152602081526101538161001f565b909283158015610393575b801561038b575b8015610361575b6103585780519060206101dc818301938451906103bd565b1561034d57604051948186019082825282604088015282606088015260808701527fffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254f60a08701527fffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551958660c082015260c081526102588161006a565b600080928192519060055afa903d15610345573d9167ffffffffffffffff831161031857604051926102b1857fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160185610086565b83523d828585013e5b156102eb57828280518101031261018c5750015190516102e693929185908181890994099151906104eb565b061490565b807f4e487b7100000000000000000000000000000000000000000000000000000000602492526001600452fd5b6024827f4e487b710000000000000000000000000000000000000000000000000000000081526041600452fd5b6060916102ba565b505050505050600090565b50505050600090565b507fffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325518310156101c4565b5082156101bd565b507fffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325518410156101b6565b7fffffffff00000001000000000000000000000000ffffffffffffffffffffffff90818110801590610466575b8015610455575b61044d577f5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b8282818080957fffffffff00000001000000000000000000000000fffffffffffffffffffffffc0991818180090908089180091490565b505050600090565b50801580156103f1575082156103f1565b50818310156103ea565b7f800000000000000000000000000000000000000000000000000000000000000081146104bc577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b909192608052600091600160a05260a05193600092811580610718575b61034d57610516838261073d565b95909460ff60c05260005b600060c05112156106ef575b60a05181036106a1575050507f4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5957f6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c2969594939291965b600060c05112156105c7575050505050507fffffffff00000001000000000000000000000000ffffffffffffffffffffffff91506105c260a051610ca2565b900990565b956105d9929394959660a05191610a98565b9097929181928960a0528192819a6105f66080518960c051610722565b61060160c051610470565b60c0528061061b5750505050505b96959493929196610583565b969b5061067b96939550919350916001810361068857507f4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5937f6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c29693610952565b979297919060a05261060f565b6002036106985786938a93610952565b88938893610952565b600281036106ba57505050829581959493929196610583565b9197917ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd0161060f575095508495849661060f565b506106ff6080518560c051610722565b8061070b60c051610470565b60c052156105215761052d565b5060805115610508565b91906002600192841c831b16921c1681018091116104bc5790565b8015806107ab575b6107635761075f91610756916107b3565b92919091610c42565b9091565b50507f6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296907f4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f590565b508115610745565b919082158061094a575b1561080f57507f6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c29691507f4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5906001908190565b7fb01cbd1c01e58065711814b583f061e9d431cca994cea1313449bf97c840ae0a917fffffffff00000001000000000000000000000000ffffffffffffffffffffffff808481600186090894817f94e82e0c1ed3bdb90743191a9c5bbf0d88fc827fd214cc5f0b5ec6ba27673d6981600184090893841561091b575050808084800993840994818460010994828088600109957f6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c29609918784038481116104bc5784908180867fffffffff00000001000000000000000000000000fffffffffffffffffffffffd0991818580090808978885038581116104bc578580949281930994080908935b93929190565b9350935050921560001461093b5761093291610b6d565b91939092610915565b50506000806000926000610915565b5080156107bd565b91949592939095811580610a90575b15610991575050831580610989575b61097a5793929190565b50600093508392508291508190565b508215610970565b85919294951580610a88575b610a78577fffffffff00000001000000000000000000000000ffffffffffffffffffffffff968703918783116104bc5787838189850908938689038981116104bc5789908184840908928315610a5d575050818880959493928180848196099b8c9485099b8c920999099609918784038481116104bc5784908180867fffffffff00000001000000000000000000000000fffffffffffffffffffffffd0991818580090808978885038581116104bc578580949281930994080908929190565b965096505050509093501560001461093b5761093291610b6d565b9550509150915091906001908190565b50851561099d565b508015610961565b939092821580610b65575b61097a577fffffffff00000001000000000000000000000000ffffffffffffffffffffffff908185600209948280878009809709948380888a0998818080808680097fffffffff00000001000000000000000000000000fffffffffffffffffffffffc099280096003090884808a7fffffffff00000001000000000000000000000000fffffffffffffffffffffffd09818380090898898603918683116104bc57888703908782116104bc578780969481809681950994089009089609930990565b508015610aa3565b919091801580610c3a575b610c2d577fffffffff00000001000000000000000000000000ffffffffffffffffffffffff90818460020991808084800980940991817fffffffff00000001000000000000000000000000fffffffffffffffffffffffc81808088860994800960030908958280837fffffffff00000001000000000000000000000000fffffffffffffffffffffffd09818980090896878403918483116104bc57858503928584116104bc5785809492819309940890090892565b5060009150819081908190565b508215610b78565b909392821580610c9a575b610c8d57610c5a90610ca2565b9182917fffffffff00000001000000000000000000000000ffffffffffffffffffffffff80809581940980099009930990565b5050509050600090600090565b508015610c4d565b604051906020918281019183835283604083015283606083015260808201527fffffffff00000001000000000000000000000000fffffffffffffffffffffffd60a08201527fffffffff00000001000000000000000000000000ffffffffffffffffffffffff60c082015260c08152610d1a8161006a565b600080928192519060055afa903d15610d93573d9167ffffffffffffffff83116103185760405192610d73857fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160185610086565b83523d828585013e5b156102eb57828280518101031261018c5750015190565b606091610d7c56fea2646970667358221220fa55558b04ced380e93d0a46be01bb895ff30f015c50c516e898c341cd0a230264736f6c63430008150033",
"nonce": "0x2",
"accessList": []
},
"additionalContracts": [],
"isFixedGasLimit": false
}
],
"receipts": [
{
"transactionHash": "0xbc5be668ab62069f5ac227c23a8b8fd85dd95c3754f7faddb8330048192adf88",
"transactionIndex": "0x2",
"blockHash": "0x468f27ff0842c770393c8eadc6cbd23245ef4346ce0ec4119c57758e657acf3f",
"blockNumber": "0x1175eb6",
"from": "0x9a57D792CC04a7bCEB5D1f8b1B7AF5F8e5695E54",
"to": "0x4e59b44847b379578588920cA78FbF26c0B4956C",
"cumulativeGasUsed": "0x136eb1",
"gasUsed": "0xc6d01",
"contractAddress": "0xc2b78104907F722DABAc4C69f826a522B2754De4",
"logs": [],
"status": "0x1",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"type": "0x2",
"effectiveGasPrice": "0x20a7b3d4d"
}
],
"libraries": [],
"pending": [],
"returns": {},
"timestamp": 1696804730,
"chain": 1,
"multi": false,
"commit": "4e81813"
}
25 changes: 0 additions & 25 deletions website/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,6 @@ First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
7 changes: 5 additions & 2 deletions website/next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/** @type {import('next').NextConfig} */
const nextConfig = {}
const nextConfig = {
// For fleek: https://nextjs.org/docs/pages/building-your-application/deploying/static-exports
output: "export",
};

module.exports = nextConfig
module.exports = nextConfig;
6 changes: 4 additions & 2 deletions website/src/app/deployments.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
"network": "Mainnet",
"address": "0xc2b78104907F722DABAc4C69f826a522B2754De4",
"type": "contract",
"gas": "334k"
"gas": "334k",
"link": "https://etherscan.io/address/0xc2b78104907F722DABAc4C69f826a522B2754De4"
},
{
"network": "Base Goerli",
"address": "0xc2b78104907F722DABAc4C69f826a522B2754De4",
"type": "contract",
"gas": "334k"
"gas": "334k",
"link": "https://goerli.basescan.org/address/0xc2b78104907F722DABAc4C69f826a522B2754De4"
}
]
30 changes: 22 additions & 8 deletions website/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function ButtonsBar({
</button>

<a
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
href="https://daimo.xyz/blog/p256verifier"
className="mx-6 group rounded-lg border px-5 py-4 transition-colors border-gray-300 hover:bg-gray-100"
target="_blank"
rel="noopener noreferrer"
Expand All @@ -151,19 +151,27 @@ function ButtonsBar({
}

function UsageTab() {
const usageCode = `bytes32 hash; // message hash
const usageCode = `import "p256-verifier/P256.sol";
bytes32 hash; // message hash
uint256 r, s; // signature
uint256 x, y; // public key
address verifier = 0xc2b78104907F722DABAc4C69f826a522B2754De4;
bytes memory args = abi.encode(hash, r, s, x, y);
(bool success, bytes memory ret) = verifier.staticcall(args);
assert(success); // never reverts, always returns 0 or 1
bool valid = abi.decode(ret, (uint256)) == 1;`;
bool valid = P256.verifySignature(hash, r, s, x, y);`;

return (
<div className="flex flex-col items-center justify-center">
<h1 className="text-xl font-bold m-4">Solidity Code</h1>
<h3 className="text-m m-4">
Install the{" "}
<a
className="text-blue-500 hover:underline"
href="https://github.com/daimo-eth/p256-verifier"
target="_blank"
>
repository
</a>
</h3>
<SyntaxHighlighter language="solidity" style={oneLight}>
{usageCode}
</SyntaxHighlighter>
Expand All @@ -180,12 +188,18 @@ type Deployment = {
address: string;
type: string;
gas: string;
link: string;
};

function DeploymentRow(deployment: Deployment) {
return (
<tr className="border-black bg-neutral-100">
<td className="border-black border px-4 py-2">{deployment.network}</td>
<td className="border-black border px-4 py-2">
{deployment.network}{" "}
<a href={deployment.link} target="_blank">
&#x1F517;
</a>
</td>
<td className="border-black border px-4 py-2">{deployment.address}</td>
<td className="border-black border px-4 py-2">{deployment.type}</td>
<td className="border-black border px-4 py-2">{deployment.gas}</td>
Expand Down

0 comments on commit 02f8b40

Please sign in to comment.