Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
e300fb5
feat(contracts): drand contract
GabrielMartinezRodriguez Dec 13, 2024
892464a
feat(contract): last adjustments to the random contract
GabrielMartinezRodriguez Dec 16, 2024
0b276cb
chore(contract): modified deployment files for random contract deploy…
GabrielMartinezRodriguez Dec 16, 2024
5d1c92a
chore(contract): format random ABI
GabrielMartinezRodriguez Dec 16, 2024
94072c3
chore(contract): pr review
GabrielMartinezRodriguez Dec 17, 2024
bc337f0
chore(contract): pr review
GabrielMartinezRodriguez Dec 17, 2024
8f32e28
chore(contract): pr review
GabrielMartinezRodriguez Dec 17, 2024
6d0c8d3
chore(contract): added comment to deploy random script
GabrielMartinezRodriguez Dec 17, 2024
73bfbd4
chore(contracts): added comments to .env.example
GabrielMartinezRodriguez Dec 17, 2024
d9c0f01
chore(contract): added comments and fixed typo
GabrielMartinezRodriguez Dec 17, 2024
5102e60
chore(contracts): rename HAPPY_TIME_BLOCK env
GabrielMartinezRodriguez Dec 17, 2024
402b48c
chore(contracts): use uint128 instead of uint256 for CurrentReveal
GabrielMartinezRodriguez Dec 17, 2024
afe73d7
chore(randomness): pr review
GabrielMartinezRodriguez Jan 8, 2025
f0ba16c
feat(randomnness): added MIN_PRECOMMIT_TIME to Randomness contract
GabrielMartinezRodriguez Jan 9, 2025
e1ca8cf
chore(contract): pr review
GabrielMartinezRodriguez Jan 21, 2025
9e33ae8
chore(contract): solve conflict
GabrielMartinezRodriguez Feb 3, 2025
b704f36
chore: format
GabrielMartinezRodriguez Feb 3, 2025
e7e47a1
chore(contract): add deployment salt
GabrielMartinezRodriguez Feb 3, 2025
d6eaecb
chore: package/contracts
GabrielMartinezRodriguez Feb 4, 2025
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
Binary file modified bun.lockb
Binary file not shown.
2 changes: 2 additions & 0 deletions contracts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@ setup:
ln $(LN_FLAGS) ../$(NODE_MODULES)/solady lib/solady
ln $(LN_FLAGS) ../$(NODE_MODULES)/kernel lib/kernel
ln $(LN_FLAGS) ../$(NODE_MODULES)/forge-std lib/forge-std
ln $(LN_FLAGS) ../$(NODE_MODULES)/@kevincharm/bls-bn254 lib/bls-bn254
ln $(LN_FLAGS) ../$(NODE_MODULES)/account-abstraction lib/account-abstraction
ln $(LN_FLAGS) ../../$(NODE_MODULES)/@openzeppelin/contracts lib/openzeppelin/src
ln $(LN_FLAGS) ../../$(NODE_MODULES)/@openzeppelin/contracts-upgradeable lib/oz-upgradeable/src

.PHONY: setup

####################################################################################################
Expand Down
284 changes: 277 additions & 7 deletions contracts/deployments/anvil/random/abis.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,28 @@
"Random": [
{
"type": "constructor",
"inputs": [],
"inputs": [
{
"name": "_publicKey",
"type": "uint256[4]",
"internalType": "uint256[4]"
},
{
"name": "_genesisTimestamp",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "_period",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "BLOCK_TIME",
"name": "DRAND_DELAY",
"inputs": [],
"outputs": [
{
Expand All @@ -18,6 +34,19 @@
],
"stateMutability": "view"
},
{
"type": "function",
"name": "DST",
"inputs": [],
"outputs": [
{
"name": "",
"type": "bytes",
"internalType": "bytes"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "PRECOMMIT_DELAY",
Expand All @@ -31,9 +60,41 @@
],
"stateMutability": "view"
},
{
"type": "function",
"name": "genesisTimestamp",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "getRevealedValue",
"inputs": [
{
"name": "blockNumber",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "nextValidTimestamp",
"inputs": [
{
"name": "timestamp",
Expand Down Expand Up @@ -63,12 +124,25 @@
],
"stateMutability": "view"
},
{
"type": "function",
"name": "period",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "postCommitment",
"inputs": [
{
"name": "timestamp",
"name": "blockNumber",
"type": "uint256",
"internalType": "uint256"
},
Expand All @@ -81,6 +155,94 @@
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "postDrand",
"inputs": [
{
"name": "round",
"type": "uint64",
"internalType": "uint64"
},
{
"name": "signature",
"type": "uint256[2]",
"internalType": "uint256[2]"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "publicKey",
"inputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "random",
"inputs": [],
"outputs": [
{
"name": "",
"type": "bytes32",
"internalType": "bytes32"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "randomForTimestamp",
"inputs": [
{
"name": "timestamp",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [
{
"name": "",
"type": "bytes32",
"internalType": "bytes32"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "randomness",
"inputs": [
{
"name": "round",
"type": "uint64",
"internalType": "uint64"
}
],
"outputs": [
{
"name": "randomness",
"type": "bytes32",
"internalType": "bytes32"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "renounceOwnership",
Expand All @@ -93,7 +255,7 @@
"name": "revealValue",
"inputs": [
{
"name": "timestamp",
"name": "blockNumber",
"type": "uint256",
"internalType": "uint256"
},
Expand Down Expand Up @@ -124,7 +286,7 @@
"name": "unsafeGetRevealedValue",
"inputs": [
{
"name": "timestamp",
"name": "blockNumber",
"type": "uint256",
"internalType": "uint256"
}
Expand All @@ -143,7 +305,7 @@
"name": "CommitmentPosted",
"inputs": [
{
"name": "timestamp",
"name": "blockNumber",
"type": "uint256",
"indexed": true,
"internalType": "uint256"
Expand Down Expand Up @@ -181,7 +343,7 @@
"name": "ValueRevealed",
"inputs": [
{
"name": "timestamp",
"name": "blockNumber",
"type": "uint256",
"indexed": true,
"internalType": "uint256"
Expand All @@ -195,6 +357,17 @@
],
"anonymous": false
},
{
"type": "error",
"name": "BNAddFailed",
"inputs": [
{
"name": "input",
"type": "uint256[4]",
"internalType": "uint256[4]"
}
]
},
{
"type": "error",
"name": "CommitmentAlreadyExists",
Expand All @@ -205,11 +378,108 @@
"name": "CommitmentTooLate",
"inputs": []
},
{
"type": "error",
"name": "DrandNotAvailable",
"inputs": [
{
"name": "round",
"type": "uint64",
"internalType": "uint64"
}
]
},
{
"type": "error",
"name": "InvalidDSTLength",
"inputs": [
{
"name": "dst",
"type": "bytes",
"internalType": "bytes"
}
]
},
{
"type": "error",
"name": "InvalidFieldElement",
"inputs": [
{
"name": "x",
"type": "uint256",
"internalType": "uint256"
}
]
},
{
"type": "error",
"name": "InvalidPublicKey",
"inputs": [
{
"name": "publicKey",
"type": "uint256[4]",
"internalType": "uint256[4]"
}
]
},
{
"type": "error",
"name": "InvalidReveal",
"inputs": []
},
{
"type": "error",
"name": "InvalidSignature",
"inputs": [
{
"name": "publicKey",
"type": "uint256[4]",
"internalType": "uint256[4]"
},
{
"name": "message",
"type": "uint256[2]",
"internalType": "uint256[2]"
},
{
"name": "signature",
"type": "uint256[2]",
"internalType": "uint256[2]"
}
]
},
{
"type": "error",
"name": "MapToPointFailed",
"inputs": [
{
"name": "noSqrt",
"type": "uint256",
"internalType": "uint256"
}
]
},
{
"type": "error",
"name": "ModExpFailed",
"inputs": [
{
"name": "base",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "exponent",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "modulus",
"type": "uint256",
"internalType": "uint256"
}
]
},
{
"type": "error",
"name": "NoCommitmentFound",
Expand Down
Loading