Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: crowdfunding contract #4917

Merged
merged 61 commits into from
Mar 7, 2024
Merged
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
b207d7a
feat: first version of crowdfunding
sirasistant Feb 19, 2024
70a938b
add to toml
sirasistant Feb 19, 2024
b9b2f77
Initial tests
sklppy88 Feb 19, 2024
73d68a7
start breaking stuffs
sirasistant Feb 19, 2024
2d6d07c
try to fix authwit
sirasistant Feb 19, 2024
d5c2ab7
fix: test
sirasistant Feb 20, 2024
79d7326
Fixing tests
sklppy88 Feb 20, 2024
251aa4e
add
sklppy88 Feb 20, 2024
94c6fa7
chore: refactor a bit test
sirasistant Feb 20, 2024
5b9349f
Working claim
sklppy88 Feb 21, 2024
5e6655f
merge
sklppy88 Feb 21, 2024
261228f
Merge remote-tracking branch 'origin/aztec_juicebox' into aztec_juicebox
sklppy88 Feb 21, 2024
c7283dc
asdf
sklppy88 Feb 21, 2024
5879412
Adding note validity
sklppy88 Feb 21, 2024
b76cc1e
Merge branch 'master' into aztec_juicebox
sklppy88 Feb 22, 2024
ec90172
allow pxe http client retries
spypsy Feb 22, 2024
64f519a
Merge branch 'master' into aztec_juicebox
sklppy88 Feb 22, 2024
d5463f9
Merge remote-tracking branch 'origin/aztec_juicebox' into aztec_juicebox
sklppy88 Feb 22, 2024
6df28df
feat: added event
sirasistant Feb 23, 2024
e317951
Merge branch 'master' into aztec_juicebox
benesjan Mar 5, 2024
e6fcbe4
fmt
benesjan Mar 5, 2024
74a278d
fixes
benesjan Mar 5, 2024
dd3ad12
no juicebox
benesjan Mar 5, 2024
5ad9915
enabling test in CI
benesjan Mar 5, 2024
bf3910f
fmt
benesjan Mar 5, 2024
1975611
WIP
benesjan Mar 5, 2024
18b6d8d
adding a TODO
benesjan Mar 5, 2024
36cac5e
Merge branch 'master' into aztec_juicebox
benesjan Mar 5, 2024
1b7e2f0
fix
benesjan Mar 5, 2024
36669db
diff cleanup
benesjan Mar 5, 2024
f58313d
adding TODO
benesjan Mar 5, 2024
dd0078f
Merge branch 'master' into aztec_juicebox
benesjan Mar 5, 2024
c29dbbb
Address comments
sklppy88 Mar 5, 2024
ee68d37
Addressing comments pt 2
sklppy88 Mar 5, 2024
4ba8385
Apply suggestions from code review
benesjan Mar 6, 2024
7e86486
import cleanup
benesjan Mar 6, 2024
16c7be5
Merge branch 'master' into aztec_juicebox
benesjan Mar 6, 2024
b60f5f6
using SharedImmutable in Claim contract + checking note contract
benesjan Mar 6, 2024
55a1ad6
Using SharedImmutable in Crowdfunding contract
benesjan Mar 6, 2024
e85a7a0
Merge branch 'master' into aztec_juicebox
benesjan Mar 6, 2024
4304d88
cleanup
benesjan Mar 6, 2024
864a9b3
fixes
benesjan Mar 6, 2024
1d8845d
naming cleanup
benesjan Mar 6, 2024
f1fc8c1
cleanup
benesjan Mar 6, 2024
d5ea55a
better test name
benesjan Mar 6, 2024
5010252
Merge branch 'master' into aztec_juicebox
benesjan Mar 6, 2024
bb3146d
final final cleanup
benesjan Mar 6, 2024
f9d2693
more negative tests
benesjan Mar 6, 2024
bd92b5b
deadline
benesjan Mar 6, 2024
891d309
Merge branch 'master' into aztec_juicebox
benesjan Mar 6, 2024
c03209c
fix
benesjan Mar 6, 2024
8a21aa2
test speedup
benesjan Mar 6, 2024
53a0a85
adding TODO
benesjan Mar 6, 2024
14dccd5
deadline test
benesjan Mar 6, 2024
0fa7c45
fix
benesjan Mar 6, 2024
b08bb0d
Merge branch 'master' into aztec_juicebox
benesjan Mar 6, 2024
6d56e9f
Update .circleci/config.yml
benesjan Mar 7, 2024
51d6fdd
Merge branch 'master' into aztec_juicebox
benesjan Mar 7, 2024
fa743bd
interface cleanup
benesjan Mar 7, 2024
790cff0
cleanup
benesjan Mar 7, 2024
3e47da7
Merge branch 'master' into aztec_juicebox
benesjan Mar 7, 2024
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
Prev Previous commit
Next Next commit
adding TODO
benesjan committed Mar 6, 2024
commit 53a0a85bda4375c8c9069c673df13854ad4df984
Original file line number Diff line number Diff line change
@@ -31,6 +31,7 @@ contract Crowdfunding {
// Crowdfunding campaign operator
operator: SharedImmutable<AztecAddress>,
// End of the crowdfunding campaign after which no more donations are accepted
// TODO(#4990): Make deadline a u64 once the neccessary traits are implemented
deadline: PublicImmutable<Field>,
// Notes emitted to donors when they donate (later on used to claim rewards in the Claim contract)
claim_notes: PrivateSet<ValueNote>,
@@ -49,6 +50,7 @@ contract Crowdfunding {
#[aztec(public)]
#[aztec(internal)]
#[aztec(noinitcheck)]
// TODO(#4990): Make deadline a u64 once the neccessary traits are implemented
fn _initialize(donation_token: AztecAddress, operator: AztecAddress, deadline: Field) {
storage.donation_token.initialize(donation_token);
storage.operator.initialize(operator);
@@ -58,6 +60,7 @@ contract Crowdfunding {
#[aztec(public)]
#[aztec(internal)]
fn _check_deadline() {
// TODO(#4990): Remove the cast here once u64 is used directly
let deadline = storage.deadline.read() as u64;
assert(context.timestamp() as u64 < deadline, "Deadline has passed");
}