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

ERC721 #584

Closed
wants to merge 62 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
c6996fa
Merge branch 'cairo-1' into erc165
martriay Mar 8, 2023
387637e
Merge branch 'erc165' into account
martriay Mar 8, 2023
90a7a4b
Merge branch 'cairo-1' into account
martriay Mar 8, 2023
f66a988
Merge branch 'cairo-1' into erc165
martriay Mar 8, 2023
e2d7248
continue account implementation
martriay Mar 8, 2023
52019ac
add missing account interface functions
martriay Mar 8, 2023
50b96bf
tidy up module
martriay Mar 8, 2023
aae6451
fix validate
martriay Mar 8, 2023
4974643
Merge branch 'cairo-1' into account
martriay Mar 8, 2023
c485e60
bump cairo + account changes
martriay Mar 9, 2023
921e61f
fix __execute__, add serde, rename felt>felt252
martriay Mar 15, 2023
fc2d995
tidy up code
martriay Mar 15, 2023
ff67d7d
WIP ERC721
Amxx Mar 19, 2023
85e869f
make format
Amxx Mar 19, 2023
c6e72ea
fix dispatcher call
Amxx Mar 19, 2023
3342d65
clean
Amxx Mar 20, 2023
3cda9e9
working on tests
Amxx Mar 20, 2023
d64b46d
replace match with `is_some()` and `is_none()` for readeability
Amxx Mar 20, 2023
587358c
erc721 tests
Amxx Mar 20, 2023
8c90954
use Option.expect
Amxx Mar 21, 2023
f756504
add account tests
martriay Mar 21, 2023
b1771d4
check panic reason
Amxx Mar 21, 2023
1d34615
rename _owner() to _owner_of()
Amxx Mar 21, 2023
5b16cad
spacing
Amxx Mar 21, 2023
ec321c0
complete account implementation
martriay Mar 24, 2023
1656dbd
apply recommandation for PR
Amxx Mar 24, 2023
331f9d5
Apply suggestions from code review
Amxx Mar 24, 2023
97ff7da
check low level ownership int
Amxx Mar 24, 2023
7f9904f
prefix test function with test_
Amxx Mar 24, 2023
27b0f7e
Apply suggestions from code review
martriay Mar 24, 2023
f2a43f5
apply review suggestions
martriay Mar 25, 2023
7e5b91b
Merge branch 'cairo-1' into erc165
martriay Mar 25, 2023
cbfb2dd
remove unused import
martriay Mar 25, 2023
2b9cfd7
merge erc165 changes
martriay Mar 25, 2023
2111a20
clarify __execute__ guard
martriay Mar 25, 2023
bd5979e
add account tests
martriay Mar 25, 2023
995fadd
add internals
martriay Mar 25, 2023
c2d4721
tidy up
martriay Mar 25, 2023
782ca23
Merge branch 'account' into erc721
Amxx Mar 28, 2023
8c38409
update ERC165 ids to u32
Amxx Mar 28, 2023
6b111ae
apply sugestions from code review
Amxx Mar 28, 2023
ed013ae
Apply suggestions from code review
Amxx Mar 28, 2023
556e0f4
update & expand tests
Amxx Mar 28, 2023
0057280
Merge remote-tracking branch 'origin/cairo-1' into erc721
Amxx Mar 28, 2023
86efbd9
update lock
Amxx Mar 28, 2023
1b9b311
Merge branch 'cairo-1' into erc165
martriay Mar 28, 2023
52357cc
add internal macro
martriay Mar 28, 2023
c615ca3
Merge branch 'erc165' into account
martriay Mar 28, 2023
cee8f05
add internal macro
martriay Mar 28, 2023
d2ddedf
add deregister
martriay Mar 31, 2023
a65e1ef
Merge branch 'erc165' into account
martriay Mar 31, 2023
2e859a4
update erc165
martriay Mar 31, 2023
d2219b6
Merge branch 'cairo-1' into erc165
martriay Mar 31, 2023
fa14e09
Merge branch 'erc165' into account
martriay Mar 31, 2023
51ac501
Merge branch 'account' into erc721
Amxx Apr 3, 2023
1dd70d9
Merge branch 'cairo-1' into erc721
Amxx May 9, 2023
61fc22f
wip (dispatched issue)
Amxx May 9, 2023
dc201a9
fix abi
Amxx May 9, 2023
1c92a2c
start array→span transition
Amxx May 9, 2023
4e7af99
Merge branch 'cairo-1' into erc721
Amxx May 12, 2023
f49c7d6
minimise account dependency
Amxx May 12, 2023
5762478
add SpanSerde in utils
Amxx May 17, 2023
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
add SpanSerde in utils
Amxx committed May 17, 2023
commit 57624781811b498c380c7740c1cd9a4655420fdf
1 change: 1 addition & 0 deletions src/openzeppelin/token/erc721.cairo
Original file line number Diff line number Diff line change
@@ -55,6 +55,7 @@ mod ERC721 {
use option::OptionTrait;
use traits::Into;
use zeroable::Zeroable;
use openzeppelin::utils::serde::SpanSerde;

struct Storage {
_name: felt252,
3 changes: 2 additions & 1 deletion src/openzeppelin/utils.cairo
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
mod constants;
mod env;
mod env;
mod serde;
19 changes: 19 additions & 0 deletions src/openzeppelin/utils/serde.cairo
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
use array::ArrayTrait;
use array::SpanTrait;
use serde::Serde;
use serde::serialize_array_helper;
use serde::deserialize_array_helper;

impl SpanSerde<
T, impl TSerde: Serde<T>, impl TCopy: Copy<T>, impl TDrop: Drop<T>
> of Serde<Span<T>> {
fn serialize(self: @Span<T>, ref output: Array<felt252>) {
(*self).len().serialize(ref output);
serialize_array_helper(*self, ref output);
}
fn deserialize(ref serialized: Span<felt252>) -> Option<Span<T>> {
let length = *serialized.pop_front()?;
let mut arr = ArrayTrait::new();
Option::Some(deserialize_array_helper(ref serialized, arr, length)?.span())
}
}