Skip to content
Open
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
57 changes: 57 additions & 0 deletions broadcast/DeployAdd5.s.sol/84532/run-1747341964.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"transactions": [
{
"hash": "0x9b03a061fa8eabbe05c69c09c1759df7f420d4a5b92aca9cc52a0b22689777a6",
"transactionType": "CREATE",
"contractName": "SimpleAdd5",
"contractAddress": "0xbdf8dbe8b5e777c1b10f5460bb7b5abbc0712920",
"function": null,
"arguments": null,
"transaction": {
"from": "0x7d20fd2bd3d13b03571a36568cfcc2a4eb3c749e",
"gas": "0x2fb5e",
"value": "0x0",
"input": "0x6080604052348015600e575f5ffd5b506101c38061001c5f395ff3fe608060405234801561000f575f5ffd5b5060043610610034575f3560e01c80633ef7df501461003857806390814b2214610056575b5f5ffd5b610040610086565b60405161004d91906100bb565b60405180910390f35b610070600480360381019061006b9190610102565b61008e565b60405161007d91906100bb565b60405180910390f35b5f6005905090565b5f60058261009c919061015a565b9050919050565b5f819050919050565b6100b5816100a3565b82525050565b5f6020820190506100ce5f8301846100ac565b92915050565b5f5ffd5b6100e1816100a3565b81146100eb575f5ffd5b50565b5f813590506100fc816100d8565b92915050565b5f60208284031215610117576101166100d4565b5b5f610124848285016100ee565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f610164826100a3565b915061016f836100a3565b92508282019050808211156101875761018661012d565b5b9291505056fea2646970667358221220cf4127f5857dcfd5fef5656d21f516c3b4cdb492b90031d5e223e2252dea03dd64736f6c634300081d0033",
"nonce": "0xda",
"chainId": "0x14a34"
},
"additionalContracts": [],
"isFixedGasLimit": false
}
],
"receipts": [
{
"status": "0x1",
"cumulativeGasUsed": "0x39b5f2",
"logs": [],
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"type": "0x2",
"transactionHash": "0x9b03a061fa8eabbe05c69c09c1759df7f420d4a5b92aca9cc52a0b22689777a6",
"transactionIndex": "0x1a",
"blockHash": "0xa749a4cac58696da92af7f2c2365d3f23060425b8236692bdb332e32a90a2521",
"blockNumber": "0x18979cc",
"gasUsed": "0x24b35",
"effectiveGasPrice": "0x403",
"from": "0x7d20fd2bd3d13b03571a36568cfcc2a4eb3c749e",
"to": null,
"contractAddress": "0xbdf8dbe8b5e777c1b10f5460bb7b5abbc0712920",
"l1BaseFeeScalar": "0x44d",
"l1BlobBaseFee": "0x1",
"l1BlobBaseFeeScalar": "0xa118b",
"l1Fee": "0xa7abf4710",
"l1GasPrice": "0x19bceec05",
"l1GasUsed": "0x171c"
}
],
"libraries": [],
"pending": [],
"returns": {
"0": {
"internal_type": "contract SimpleAdd5",
"value": "0xbDF8dbE8B5E777c1B10f5460Bb7b5aBBc0712920"
}
},
"timestamp": 1747341964,
"chain": 84532,
"commit": "ec0baad"
}
57 changes: 57 additions & 0 deletions broadcast/DeployAdd5.s.sol/84532/run-1747342615.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"transactions": [
{
"hash": "0x5938a74052db219465d82e68482cde093a84e60cc25537676a66115b8adb25ef",
"transactionType": "CREATE",
"contractName": "SimpleAdd5",
"contractAddress": "0xbd2a5addf2e7fb05c5e4e7593fb9a9e78dad2b17",
"function": null,
"arguments": null,
"transaction": {
"from": "0x7d20fd2bd3d13b03571a36568cfcc2a4eb3c749e",
"gas": "0x335bc",
"value": "0x0",
"input": "0x6080604052348015600e575f5ffd5b506101f88061001c5f395ff3fe608060405234801561000f575f5ffd5b506004361061003f575f3560e01c80633ef7df501461004357806390814b2214610061578063abcc11d814610091575b5f5ffd5b61004b6100af565b60405161005891906100f0565b60405180910390f35b61007b60048036038101906100769190610137565b6100b7565b60405161008891906100f0565b60405180910390f35b6100996100d3565b6040516100a691906100f0565b60405180910390f35b5f6005905090565b5f6005826100c5919061018f565b5f819055505f549050919050565b5f5481565b5f819050919050565b6100ea816100d8565b82525050565b5f6020820190506101035f8301846100e1565b92915050565b5f5ffd5b610116816100d8565b8114610120575f5ffd5b50565b5f813590506101318161010d565b92915050565b5f6020828403121561014c5761014b610109565b5b5f61015984828501610123565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f610199826100d8565b91506101a4836100d8565b92508282019050808211156101bc576101bb610162565b5b9291505056fea2646970667358221220f225dd3cde0e76626f9231bccf661e287c915063564ed31b7b8db4b56341d40464736f6c634300081d0033",
"nonce": "0xdb",
"chainId": "0x14a34"
},
"additionalContracts": [],
"isFixedGasLimit": false
}
],
"receipts": [
{
"status": "0x1",
"cumulativeGasUsed": "0xd2ef7",
"logs": [],
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"type": "0x2",
"transactionHash": "0x5938a74052db219465d82e68482cde093a84e60cc25537676a66115b8adb25ef",
"transactionIndex": "0x9",
"blockHash": "0x222be76127e4d2a3b423b43bc68ef4e6cf4e18e60f769b338782b9eb24f41686",
"blockNumber": "0x1897b12",
"gasUsed": "0x2781b",
"effectiveGasPrice": "0x397",
"from": "0x7d20fd2bd3d13b03571a36568cfcc2a4eb3c749e",
"to": null,
"contractAddress": "0xbd2a5addf2e7fb05c5e4e7593fb9a9e78dad2b17",
"l1BaseFeeScalar": "0x44d",
"l1BlobBaseFee": "0x1",
"l1BlobBaseFeeScalar": "0xa118b",
"l1Fee": "0x655413575",
"l1GasPrice": "0xe69c0221",
"l1GasUsed": "0x18f1"
}
],
"libraries": [],
"pending": [],
"returns": {
"0": {
"internal_type": "contract SimpleAdd5",
"value": "0xbd2a5aDdf2e7fB05c5E4e7593fb9a9E78DaD2b17"
}
},
"timestamp": 1747342615,
"chain": 84532,
"commit": "ec0baad"
}
57 changes: 57 additions & 0 deletions broadcast/DeployAdd5.s.sol/84532/run-1747342858.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"transactions": [
{
"hash": "0x8af409f58cf63c2978a9f46e2bc0432f48c18f88461a52bfcdc7fa1099dcbc01",
"transactionType": "CREATE",
"contractName": "SimpleAdd5",
"contractAddress": "0x6854ef69cd25b0d6583f4f4fde4f660b37eda9fe",
"function": null,
"arguments": null,
"transaction": {
"from": "0x7d20fd2bd3d13b03571a36568cfcc2a4eb3c749e",
"gas": "0x2bf07",
"value": "0x0",
"input": "0x6080604052348015600e575f5ffd5b5061018c8061001c5f395ff3fe608060405234801561000f575f5ffd5b506004361061003f575f3560e01c80633ef7df5014610043578063661d882914610061578063abcc11d81461007f575b5f5ffd5b61004b61009d565b60405161005891906100dd565b60405180910390f35b6100696100a5565b60405161007691906100dd565b60405180910390f35b6100876100c0565b60405161009491906100dd565b60405180910390f35b5f6005905090565b5f60055f546100b49190610123565b5f819055505f54905090565b5f5481565b5f819050919050565b6100d7816100c5565b82525050565b5f6020820190506100f05f8301846100ce565b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61012d826100c5565b9150610138836100c5565b92508282019050808211156101505761014f6100f6565b5b9291505056fea264697066735822122089964f00c54ba20b6d00c2e8ff6dbad69049bbb1f4bf424a4e10291ecc8d13dc64736f6c634300081d0033",
"nonce": "0xdc",
"chainId": "0x14a34"
},
"additionalContracts": [],
"isFixedGasLimit": false
}
],
"receipts": [
{
"status": "0x1",
"cumulativeGasUsed": "0x35fa27",
"logs": [],
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"type": "0x2",
"transactionHash": "0x8af409f58cf63c2978a9f46e2bc0432f48c18f88461a52bfcdc7fa1099dcbc01",
"transactionIndex": "0x16",
"blockHash": "0x06ba5789191f7012e63475196f8c7a3d720c6bcf9429840a21f3d7881d75778c",
"blockNumber": "0x1897b8b",
"gasUsed": "0x21ccb",
"effectiveGasPrice": "0x189e4",
"from": "0x7d20fd2bd3d13b03571a36568cfcc2a4eb3c749e",
"to": null,
"contractAddress": "0x6854ef69cd25b0d6583f4f4fde4f660b37eda9fe",
"l1BaseFeeScalar": "0x44d",
"l1BlobBaseFee": "0x1",
"l1BlobBaseFeeScalar": "0xa118b",
"l1Fee": "0x4f6bf6adf",
"l1GasPrice": "0xdbf00776",
"l1GasUsed": "0x147f"
}
],
"libraries": [],
"pending": [],
"returns": {
"0": {
"internal_type": "contract SimpleAdd5",
"value": "0x6854eF69CD25b0D6583F4f4fDe4F660b37eda9fe"
}
},
"timestamp": 1747342858,
"chain": 84532,
"commit": "ec0baad"
}
57 changes: 57 additions & 0 deletions broadcast/DeployAdd5.s.sol/84532/run-latest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"transactions": [
{
"hash": "0x8af409f58cf63c2978a9f46e2bc0432f48c18f88461a52bfcdc7fa1099dcbc01",
"transactionType": "CREATE",
"contractName": "SimpleAdd5",
"contractAddress": "0x6854ef69cd25b0d6583f4f4fde4f660b37eda9fe",
"function": null,
"arguments": null,
"transaction": {
"from": "0x7d20fd2bd3d13b03571a36568cfcc2a4eb3c749e",
"gas": "0x2bf07",
"value": "0x0",
"input": "0x6080604052348015600e575f5ffd5b5061018c8061001c5f395ff3fe608060405234801561000f575f5ffd5b506004361061003f575f3560e01c80633ef7df5014610043578063661d882914610061578063abcc11d81461007f575b5f5ffd5b61004b61009d565b60405161005891906100dd565b60405180910390f35b6100696100a5565b60405161007691906100dd565b60405180910390f35b6100876100c0565b60405161009491906100dd565b60405180910390f35b5f6005905090565b5f60055f546100b49190610123565b5f819055505f54905090565b5f5481565b5f819050919050565b6100d7816100c5565b82525050565b5f6020820190506100f05f8301846100ce565b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61012d826100c5565b9150610138836100c5565b92508282019050808211156101505761014f6100f6565b5b9291505056fea264697066735822122089964f00c54ba20b6d00c2e8ff6dbad69049bbb1f4bf424a4e10291ecc8d13dc64736f6c634300081d0033",
"nonce": "0xdc",
"chainId": "0x14a34"
},
"additionalContracts": [],
"isFixedGasLimit": false
}
],
"receipts": [
{
"status": "0x1",
"cumulativeGasUsed": "0x35fa27",
"logs": [],
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"type": "0x2",
"transactionHash": "0x8af409f58cf63c2978a9f46e2bc0432f48c18f88461a52bfcdc7fa1099dcbc01",
"transactionIndex": "0x16",
"blockHash": "0x06ba5789191f7012e63475196f8c7a3d720c6bcf9429840a21f3d7881d75778c",
"blockNumber": "0x1897b8b",
"gasUsed": "0x21ccb",
"effectiveGasPrice": "0x189e4",
"from": "0x7d20fd2bd3d13b03571a36568cfcc2a4eb3c749e",
"to": null,
"contractAddress": "0x6854ef69cd25b0d6583f4f4fde4f660b37eda9fe",
"l1BaseFeeScalar": "0x44d",
"l1BlobBaseFee": "0x1",
"l1BlobBaseFeeScalar": "0xa118b",
"l1Fee": "0x4f6bf6adf",
"l1GasPrice": "0xdbf00776",
"l1GasUsed": "0x147f"
}
],
"libraries": [],
"pending": [],
"returns": {
"0": {
"internal_type": "contract SimpleAdd5",
"value": "0x6854eF69CD25b0D6583F4f4fDe4F660b37eda9fe"
}
},
"timestamp": 1747342858,
"chain": 84532,
"commit": "ec0baad"
}
229 changes: 229 additions & 0 deletions broadcast/DeployProd.s.sol/10/run-1747445095.json

Large diffs are not rendered by default.

164 changes: 84 additions & 80 deletions broadcast/DeployProd.s.sol/10/run-latest.json

Large diffs are not rendered by default.

172 changes: 172 additions & 0 deletions broadcast/DeployProd.s.sol/42161/run-1747445128.json

Large diffs are not rendered by default.

153 changes: 153 additions & 0 deletions broadcast/DeployProd.s.sol/42161/run-1747445166.json

Large diffs are not rendered by default.

153 changes: 153 additions & 0 deletions broadcast/DeployProd.s.sol/42161/run-1747445279.json

Large diffs are not rendered by default.

131 changes: 47 additions & 84 deletions broadcast/DeployProd.s.sol/42161/run-latest.json

Large diffs are not rendered by default.

225 changes: 225 additions & 0 deletions broadcast/DeployProd.s.sol/8453/run-1747444992.json

Large diffs are not rendered by default.

156 changes: 78 additions & 78 deletions broadcast/DeployProd.s.sol/8453/run-latest.json

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions script/DeployAdd5.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.29;

import { Script } from "forge-std/Script.sol";
import { SimpleAdd5 } from "../src/SimpleAdd5.sol";

contract DeployAdd5 is Script {
function run() public returns (SimpleAdd5) {
vm.startBroadcast();
SimpleAdd5 simpleAdd5 = new SimpleAdd5();
vm.stopBroadcast();
return simpleAdd5;
}
}
7 changes: 1 addition & 6 deletions src/CryptoUtils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ contract CryptoUtils {
uint256 public constant MAX_PLAYERS = 10;
uint8 public constant EMPTY_SEAT = 255;

event CULog(string message);

constructor() {
// Initialize P_2048
// bytes memory p2048Bytes =
Expand Down Expand Up @@ -62,13 +60,10 @@ contract CryptoUtils {
EncryptedCard memory encryptedCard,
BigNumber memory privateKey,
BigNumber memory c1InversePowPrivateKey
) public returns (BigNumber memory) {
) public view returns (BigNumber memory) {
BigNumber memory c1PowPrivateKey = BigNumbers.modexp(encryptedCard.c1, privateKey, P_2048);
emit CULog("c1PowPrivateKey");
bool verifyResult = BigNumbers.modinvVerify(c1PowPrivateKey, P_2048, c1InversePowPrivateKey);
emit CULog("verifyResult");
require(verifyResult, "Invalid modular inverse");
emit CULog("modmul");
return BigNumbers.modmul(encryptedCard.c2, c1InversePowPrivateKey, P_2048);
}

Expand Down
21 changes: 21 additions & 0 deletions src/SimpleAdd5.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.29;

/// @title SimpleAdd5
/// @notice A simple contract that demonstrates basic arithmetic operations
contract SimpleAdd5 {
uint256 public lastResult;

/// @notice Returns the number 5
/// @return The number 5
function getFive() public pure returns (uint256) {
return 5;
}

/// @notice Adds 5 to the last result
/// @return The result of adding 5 to the last result
function addFive() public returns (uint256) {
lastResult = lastResult + 5;
return lastResult;
}
}
Loading