Skip to content

Commit

Permalink
Merge cairo-2 (#760)
Browse files Browse the repository at this point in the history
* fix: link (#545)

* add submodule

* update cairo

* add Cargo and Makefile

* update cairo

* add deps in cairo_project, create lib

* add presets

* add base lib

* add tests

* remove old cairo lib and interface

* remove unused import

* fix vars

* change external funcs to snake case

* remove unused import

* update cairo

* add tests for externals

* add bool assertions

* update cairo

* remove preset mods

* add IERC20 trait

* update cairo

* clean up test

* remove assertion

* update cairo

* simplify max_u256

* clarify error msg

* add erc165 + tests

* kickstart account module

* clean up python project. ready for rust/cairo1

* re-structure project

* re-structure project

* re-structure project

* update makefile

* bump submodule

* Update erc20 migration branch (#586)

* Change the spelling of "StarkNet" to "Starknet" (#557)

* fix: link (#545)

* change StarkNet to Starknet

---------

Co-authored-by: Eric Nordelo <[email protected]>

* add Cargo and Makefile

* add deps in cairo_project, create lib

* add presets

* add base lib

* add tests

* remove old cairo lib and interface

* remove unused import

* fix vars

* change external funcs to snake case

* remove unused import

* add tests for externals

* add bool assertions

* remove preset mods

* add IERC20 trait

* clean up test

* remove assertion

* simplify max_u256

* clarify error msg

* clean up python project. ready for rust/cairo1

* add erc165 + tests

* kickstart account module

* re-structure project

* re-structure project

* re-structure project

* update makefile

* re-structure project

* update to felt252, add use ContractAddress

* formatting

* remove colons from storage, remove _mint from initializer

* add constructor test

* add comments

* fix format

* check error msg in tests

* set max_u256 as func

* update cairo

* update cargo

* revert doc commit

* remove __init__

* refix link

---------

Co-authored-by: kongtaoxing <[email protected]>
Co-authored-by: Eric Nordelo <[email protected]>
Co-authored-by: Martín Triay <[email protected]>

* Migrate security/initializable (#592)

* update cairo

* fix path

* add security mod

* add initializable

* add tests

* Update src/openzeppelin/security/initializable.cairo

Co-authored-by: Martín Triay <[email protected]>

* remove underscore

* add internal macros

---------

Co-authored-by: Martín Triay <[email protected]>

* Use zeroable::zero() instead of contract_address_const::<0>() (#598)

* use zeroable for address

* cleanup import

* Migrate security/pausable (#593)

* fix path

* add security mod

* add pausable

* add mock

* add tests

* add security mod

* update cargo

* update cairo

* Apply suggestions from code review

Co-authored-by: Martín Triay <[email protected]>

* remove underscore from _paused

* remove unused imports

* add test assertion for is_paused

* move mocks inside tests crate

* remove underscore

* add blank line

---------

Co-authored-by: Martín Triay <[email protected]>

* add utils and constants

* Revert "add utils and constants"

This reverts commit e86bcd2107b052e13c58a9af7907e1f82e427a60.

* Migrate ERC165 (#582)

* Apply suggestions from code review

Co-authored-by: Andrew Fleming <[email protected]>
Co-authored-by: Hadrien Croubois <[email protected]>

* apply review suggestions

* remove unused import

* add internal macro

* add deregister

---------

Co-authored-by: Andrew Fleming <[email protected]>
Co-authored-by: Hadrien Croubois <[email protected]>

* Migrate constants (#611)

* add utils and constants

* simplify role val

* add context comments for interface ids

* Set up new CI (#599)

* add lint and test

* fix name

* add md linter

* add header

* remove extra line

* add blank line

* remove env

* change name

* fix on condition

* change name

* fix formatting

* remove trailing comma in storage

* fix formatting (#613)

* Normalize error message style (#606)

* normalize error msg

* update cairo

* update Cargo

* fix test command

* update should_panic syntax

* use super for interface import

* Add `BoundedInt` and internal macros, update cairo (#600)

* update cairo

* update Cargo

* remove path flag

* refactor _spend_allowance with BoundedInt

* add BoundedInt for u256_max

* add internal macros

* update cairo

* update cairo

* update Cargo

* remove import

* update expected syntax

* remove redundant maxu256 fn

* update expected syntax

* Update src/openzeppelin/tests/test_erc20.cairo

Co-authored-by: Hadrien Croubois <[email protected]>

* use into trait

* use address zeroable in mod

* set cairo to alpha7

* update Cargo

---------

Co-authored-by: Hadrien Croubois <[email protected]>

* Migrate ownable (#604)

* add ownable

* add ownable tests

* simplify renounce

* fix formatting

* add internal macros

* Apply suggestions from code review

Co-authored-by: Martín Triay <[email protected]>

* add test_transfer_ownership_from_zero

* update cairo to alpha7

* update Cargo

* fix expected syntax

* update cairo to rc0

* update Cargo

* fix import

* simplify imports

* Apply suggestions from code review

Co-authored-by: Eric Nordelo <[email protected]>

* Update src/openzeppelin/token/erc20.cairo

Co-authored-by: Eric Nordelo <[email protected]>

* fix set_caller_address

---------

Co-authored-by: Martín Triay <[email protected]>
Co-authored-by: Eric Nordelo <[email protected]>

* Migrate security/reentrancyguard (#590)

* add reentrancyguard

* update Cargo

* remove mytest

* add reentrancy mocks

* add utils

* finish tests

* remove unused func

* add comments

* clean up code

* clean up code

* Apply suggestions from code review

Co-authored-by: Martín Triay <[email protected]>

* remove underscore

* remove constructor in mock

* update interface name

* change count_this_recursive to count_external_recursive

* move mocks inside tests dir

* remove underscore

* update cairo to alpha7

* update Cargo

* add withdraw_gas

* fix formatting

* update cairo to rc0

* update Cargo

* fix import

* simplify imports

* remove duplicate import

* rename mod

* add mock interface

* finish tests

* update cairo

* add new line

* Update src/openzeppelin/tests/mocks/reentrancy_mock.cairo

Co-authored-by: Eric Nordelo <[email protected]>

* import dispatchers

* fix formatting

* Apply suggestions from code review

Co-authored-by: Martín Triay <[email protected]>

* add deploy fn to utils

* use deploy from utils

---------

Co-authored-by: Martín Triay <[email protected]>
Co-authored-by: Eric Nordelo <[email protected]>

* Migrate access control (#605)

* add accesscontrol

* add accesscontrol tests

* remove mock, add impl to contract

* fix formatting

* remove accesscontrol mock

* formatting, remove unused imports

* integrate erc165

* fix typo

* update cairo to alpha7

* update Cargo

* update expected syntax

* update expected syntax

* update cairo to rc0

* update Cargo

* fix import

* simplify imports

* Apply suggestions from code review

Co-authored-by: Martín Triay <[email protected]>

* fix storage mapping name

* rename impl

* add warning

* fix comment

* remove constructor, setup test constructor in setup

* fix format

* fix import format

* add test for granting already granted role

* add clarity to revoke role test

* add test for revoking already revoked role

* add test for renouncing already renounced role

* add test for revoked admin role losing privileges

* fix test_role_admin_cycle

* add target func as comment

* add default admin tests

* refactor tests, rename actors

* add tests for has_role and set_role_admin

* tidy up tests

* add general doc for events

* fix assert_only_role test

* remove redundant test

* remove unnecessary assertion

* remove duplicate test

* Update src/openzeppelin/access/accesscontrol.cairo

Co-authored-by: Martín Triay <[email protected]>

* fix imports, define constants locally

* Apply suggestions from code review

Co-authored-by: Martín Triay <[email protected]>

* fix test name

* bump cairo

* fix formatting

---------

Co-authored-by: Martín Triay <[email protected]>

* Migrate account (#620)

* continue account implementation

* add missing account interface functions

* tidy up module

* fix validate

* bump cairo + account changes

* fix __execute__, add serde, rename felt>felt252

* tidy up code

* add account tests

* complete account implementation

* Apply suggestions from code review

Co-authored-by: Andrew Fleming <[email protected]>
Co-authored-by: Hadrien Croubois <[email protected]>

* apply review suggestions

* remove unused import

* clarify __execute__ guard

* add account tests

* add internals

* tidy up

* add internal macro

* add internal macro

* add deregister

* update erc165

* feat: refactor account and add validate_transaction test

* feat: work on span serde

* feat: add test for validate

* refactor: remove unnecessary imports

* refactor: tests

* feat: implement test_execute

* Update src/openzeppelin/tests/test_account.cairo

Co-authored-by: Martín Triay <[email protected]>

* Update src/openzeppelin/tests/test_account.cairo

Co-authored-by: Martín Triay <[email protected]>

* feat: update from review

* feat: format files

* feat: SpanSerde compiling version

* feat: update tests and interface

* feat: format file

* feat: add test for multicall

* feat: add more tests

* test: remove unused function

* refactor: update ERC20 interface and module

* feat: add impl again

* refactor: apply review comments

* test: execute out of gas

* refactor: is valid signature because of lack of short circuit condicionals

* refactor: apply updates from reviews

* feat: add SpanSerde implementation

* refactor: remove span_to_array

* Update src/openzeppelin/tests/test_account.cairo

Co-authored-by: Andrew Fleming <[email protected]>

* Update src/openzeppelin/account.cairo

Co-authored-by: Andrew Fleming <[email protected]>

* test: update from review

* feat: splitting account interface and abi

* feat: add new account files

* remove underscore on mod api methods

* remove comment

* remove underscore

* move erc1271 id to interface

* remove unused import

* integrate deploy util

* add comments for validate dummy params

* add initializer

* change error msg

* add empty sig tests

* move test

* replace dummy args, fix comments

* fix formatting

* tidy up code

* add erc20 transfer call in execute test

* tidy up imports

* remove unused const

---------

Co-authored-by: Martín Triay <[email protected]>
Co-authored-by: Hadrien Croubois <[email protected]>
Co-authored-by: Eric Nordelo <[email protected]>

* Migrate ERC721 (#619)

* continue account implementation

* add missing account interface functions

* tidy up module

* fix validate

* bump cairo + account changes

* fix __execute__, add serde, rename felt>felt252

* tidy up code

* WIP ERC721

* make format

* fix dispatcher call

* clean

* working on tests

* replace match with `is_some()` and `is_none()` for readeability

* erc721 tests

* use Option.expect

* add account tests

* check panic reason

* rename _owner() to _owner_of()

* spacing

* complete account implementation

* apply recommandation for PR

* Apply suggestions from code review

Co-authored-by: Andrew Fleming <[email protected]>

* check low level ownership int

* prefix test function with test_

* Apply suggestions from code review

Co-authored-by: Andrew Fleming <[email protected]>
Co-authored-by: Hadrien Croubois <[email protected]>

* apply review suggestions

* remove unused import

* clarify __execute__ guard

* add account tests

* add internals

* tidy up

* update ERC165 ids to u32

* apply sugestions from code review

* Apply suggestions from code review

Co-authored-by: Martín Triay <[email protected]>

* update & expand tests

* update lock

* add internal macro

* add internal macro

* add deregister

* update erc165

* wip (dispatched issue)

* fix abi

* start array→span transition

* minimise account dependency

* add SpanSerde in utils

* add dual interfaces

* update test message. fix linter

* split interfaces from preset module

* fix linter

* rename metadata id var

* add camelCase to traits

* fully implement dual interface traits

* simplify _owner_of

* add constructor and getter tests

* add token_uri tests

* remove conflictive test

* add erc721receiver. add IERC721ABI

* add safe_transfer_from tests

* add safe_mint tests

* Update src/openzeppelin/token/erc721/interface.cairo

Co-authored-by: Eric Nordelo <[email protected]>

* move erc721 abi next to module

* address review comments

---------

Co-authored-by: Hadrien Croubois <[email protected]>
Co-authored-by: Andrew Fleming <[email protected]>
Co-authored-by: Andrew Fleming <[email protected]>
Co-authored-by: Eric Nordelo <[email protected]>

* Dual interface dispatcher for ERC721 (#623)

* add dual interface dispatcher draft

* complete dual721 implementation

* fix format

* add felt252 <> bool casts

* simplify Felt252IntoBool

* make felt252 into -> try_into

* add base test suite

* implement most tests

* add mocks

* add tests for panic cases

* fix some tests

* fix format

* fix more tests

* fix tests

* apply review feedback

* normalize mock names

* add token_uri tests

* rename non implementing mock

* move comment

* upgrade to cairo 1.1.1

* Update src/openzeppelin/utils.cairo

Co-authored-by: Eric Nordelo <[email protected]>

* address review comments

---------

Co-authored-by: Eric Nordelo <[email protected]>

* Replace ERC-165 with SRC-5 (Update Interface Ids) (#637)

* feat: add src5 module

* refactor: interface ids and account standard interface

* refactor: naming convention

* refactor: separate interfaces

* feat: apply last SNIP update

* fix: account interface signature

* feat: apply updates from review

* fix: accesscontrol interface id

* Update src/openzeppelin/account/account.cairo

Co-authored-by: Andrew Fleming <[email protected]>

* feat: apply update from review

---------

Co-authored-by: Andrew Fleming <[email protected]>

* Fix conflicts from the dual721 and src5 merge (#641)

* add abi to interfaces

* change u32 to felt

* Add camel support for ownable (#625)

* add camel support

* add camel tests

* nest ownable into dir

* move interface

* add dual ownable

* add const selectors

* add try_selector_with_fallback and bool impl

* nest access tests in test dirs

* move accesscontrol and ownable test mods

* move tests

* move tests

* add mocks

* add dual ownable tests

* add panic traits

* tidy up tests

* fix formatting

* remove comments

* fix hierarchy

* remove import comments

* remove comment

* Apply suggestions from code review

Co-authored-by: Martín Triay <[email protected]>

* remove unused import

* fix camel dispatcher

* normalize assert error msg

* fix formatting

* remove redundant assertion

* change selector casing

* remove unused import

* fix comments, add ref for ignored tests

* fix comments

* remove panic trait

* bump to cairo v1.1.1

* update Cargo

* remove ignore from tests

* Apply suggestions from code review

Co-authored-by: Eric Nordelo <[email protected]>

* remove selectors from constants

* add selectors to selectors.cairo

* remove selector bindings

* fix comment

* remove/fix comments

* fix conflicts

* Update src/openzeppelin/utils/selectors.cairo

Co-authored-by: Eric Nordelo <[email protected]>

---------

Co-authored-by: Martín Triay <[email protected]>
Co-authored-by: Eric Nordelo <[email protected]>

* Add camel support for access control (#626)

* add camel support

* add camel tests

* move accesscontrol into dir

* separate interface

* add try_selector_with_fallback and bool impl

* add const selectors

* add dual accesscontrol

* move access tests

* add panic trait

* add accesscontrol mocks

* add dual accesscontrol tests

* fix formatting

* Apply suggestions from code review

Co-authored-by: Eric Nordelo <[email protected]>

* add comment to supportsInterface

* add tests for supports_interface

* remove comments

* alphabetize use clauses

* remove util panic trait

* remove unused imports

* remove unused imports

* remove unused import

* update selector casings

* Apply suggestions from code review

Co-authored-by: Martín Triay <[email protected]>

* fix casing on target calls

* add space to comments

* remove comments, add ref with ignored tests

* remove unused imports

* remove selectors from constants

* add selectors to selectors mod

* fix formatting

* reorder selectors

* fix comment

* update interface id

* replace erc165 with src5

* fix conflicts

* replace u32 with felt

* add abi to interfaces

* remove ignore from tests

* fix formatting

* fix comment

* remove camel supportsInterface

* fix comment consistency

* Update src/openzeppelin/tests/access/test_dual_accesscontrol.cairo

Co-authored-by: Eric Nordelo <[email protected]>

* add append_serde

* change append to append_serde

* remove unused import

* remove bindings

---------

Co-authored-by: Eric Nordelo <[email protected]>
Co-authored-by: Martín Triay <[email protected]>

* erc20 dual dispatcher (#622)

* add camel methods

* update erc20 dispatcher path

* refactor tests, add tests for camel methods

* fix formatting

* add try_selector_with_fallback and bool impl

* add erc20 selectors

* add abi to traits

* add dual20 mocks

* add panic trait

* add dual20 mocks

* add dual20

* add dual20

* add dual20 tests

* tidy up tests

* move tests to token dir

* fix formatting

* clean up tests

* restructure token tests

* remove panic trait

* reorder imports

* remove unused imports

* fix comments

* update const selector casings

* remove comments

* Apply suggestions from code review

Co-authored-by: Eric Nordelo <[email protected]>

* change target member to contract_address

* fix formatting

* fix dispatcher calls

* change dispatcher to dual_dispatcher

* reorder use clauses

* move selectors to selectors mod

* fix formatting

* reorder selectors

* remove duplicate selectors

* remove ignore

* simplify dispatcher vars

* fix comment

* Apply suggestions from code review

Co-authored-by: Eric Nordelo <[email protected]>

* fix test constants

* add SerializedAppend trait

* integrate append_serde

* integrate append_serde and utils selector

* change u256 fns to constants

* change u256 fns to constants

* move dual721 test to token/, apply append_serde, change u256 fn to constant

* fix formatting

* add append_serde

* move append_serde to serde

* update append_serde path

* change dispatcher to IERC20

* remove unnecessary into()

* remove bindings

* add binding to empty arrays

* fix formatting

---------

Co-authored-by: Eric Nordelo <[email protected]>

* Add `UnwrapAndCast` trait (#644)

* add unwrap_and_cast trait and impls

* use unwrap_and_cast

* tidy up code

* add UnwrapAndCastU8 impl

* reorder use clauses

* use unwrap_and_cast on view fns

* add test_dual721 mod (#648)

* Update account interface (#646)

* feat: update interface and ids

* refactor: format files

* feat: update from reviews

* Update src/openzeppelin/account/account.cairo

Co-authored-by: Andrew Fleming <[email protected]>

---------

Co-authored-by: Andrew Fleming <[email protected]>

* Add camel support for Account (#647)

* feat: update interface and ids

* refactor: format files

* feat: update from reviews

* feat: add dual interface to account

* fix: tests

* feat: add tests

* feat: add more tests

* feat: apply review suggestions

* feat: apply review updates

* Update src/openzeppelin/tests/account/test_dual_account.cairo

Co-authored-by: Andrew Fleming <[email protected]>

---------

Co-authored-by: Andrew Fleming <[email protected]>

* Add src5 dual dispatcher (#659)

* add dual src5

* add dual src5 tests and mocks

* add felt impl

* remove unused imports, integrate unwrap_and_cast for felts

* add supports_interface to interface

* add supports_interface to erc721 interface

* add camelCase supportsInterface test

* add dual supports_interface to mocks

* add dual supports_interface tests

* add dual supports_interface to tests

* add comment

* fix formatting

* clean up test

* add comments

* remove unused imports

* fix interface

* fix src5 impl

* apply review suggestion

* Add dual case erc721 receiver (#649)

* add 721 holder

* add 721 receiver selectors

* add abis

* add dual receiver

* add dual receiver mocks

* add dual 721 receiver and holder mods

* add dual 721 receiver tests

* integrate dual case receiver

* remove camel supportsInterface

* add isrc5 impl

* add isrc5 impl

* fix formatting

* change receiver import

* remove unused mod

* add isrc5 impl

* remove mod

* fix formatting

* remove conflict

* add felt impl to UnwrapAndCast

* clean up mocks

* add camelCase ISRC5 impl

* add camelCase tests for safe methods

* fix test

* remove unused imports

* remove unused imports

* remove unused imports

* Apply suggestions from code review

Co-authored-by: Eric Nordelo <[email protected]>

* add transferFrom and safeTransferFrom tests

* fix comments

* fix comments

---------

Co-authored-by: Eric Nordelo <[email protected]>

* Add owner param to ownable initializer (#660)

* feat: add owner param to ownable initializer

* feat: apply review updates

* fix: remove unnecessary mut

* Update src/openzeppelin/tests/access/test_dual_ownable.cairo

Co-authored-by: Andrew Fleming <[email protected]>

---------

Co-authored-by: Andrew Fleming <[email protected]>

* Migrate SRC5 to Cairo 2 (#664)

* feat: migrate files

* feat: add interface.cairo

* feat: apply review updates

* refactor: improve readability

* Migrate initializable to cairo2 (#661)

* bump to cairo v2.0.2

* update Cargo

* comment out mods

* update initializable syntax

* move security tests

* update initializable tests

* fix formatting

* update cairo

* update Cargo

* simplify and clarify tests

* fix formatting

* Apply suggestions from code review

Co-authored-by: Eric Nordelo <[email protected]>

* fix tests

---------

Co-authored-by: Eric Nordelo <[email protected]>

* Migrate Account to Cairo 2 (#666)

* feat: migrate files

* feat: add interface.cairo

* feat: apply review updates

* refactor: improve readability

* fix: dual account tests

* fix: account tests

* feat: apply review updates

* Migrate pausable to cairo2 (#662)

* bump to cairo v2.0.2

* update Cargo

* comment out mods

* update initializable syntax

* move security tests

* update initializable tests

* fix formatting

* update pausable syntax

* update pausable tests

* update cairo

* update Cargo

* simplify and clarify tests

* fix formatting

* simplify and clarify tests

* Apply suggestions from code review

Co-authored-by: Eric Nordelo <[email protected]>

* fix tests

* change StorageTrait to InternalTrait

* use InternalImpl

* add external pausable impl

* Apply suggestions from code review

Co-authored-by: Eric Nordelo <[email protected]>

---------

Co-authored-by: Eric Nordelo <[email protected]>

* Migrate reentrancyguard to cairo2 (#663)

* bump to cairo v2.0.2

* update Cargo

* comment out mods

* update initializable syntax

* move security tests

* update initializable tests

* fix formatting

* remove SpanSerde

* update reentrancyguard syntax

* add reentrancyguard mocks

* update reentrancyguard tests

* update cairo

* update Cargo

* simplify and clarify tests

* fix formatting

* simplify and clarify tests

* fix formatting

* Apply suggestions from code review

Co-authored-by: Eric Nordelo <[email protected]>

* fix tests

* change StorageTrait to InternalTrait

* remove internal is_entered

* use internal contract state

* Apply suggestions from code review

Co-authored-by: Eric Nordelo <[email protected]>

* fix import order

* change generic state to TState

---------

Co-authored-by: Eric Nordelo <[email protected]>

* Migrate ERC721 to Cairo2 (#667)

* feat: migrate files

* feat: add interface.cairo

* feat: apply review updates

* refactor: improve readability

* fix: dual account tests

* fix: account tests

* fix: mocks

* fix: dual721 tests

* fix: erc721 tests

* feat: apply review updates

* feat: apply review suggestions

* Migrate ownable to cairo2 (#665)

* bump to cairo v2.0.2

* update Cargo

* comment out mods

* update initializable syntax

* move security tests

* update initializable tests

* fix formatting

* remove SpanSerde

* update ownable syntax

* add ownable_camel impl

* update syntax in ownable mocks

* update ownable tests

* fix formatting

* update cairo

* update Cargo

* simplify and clarify tests

* fix formatting

* simplify internal fns

* add initializer

* fix constructor, tidy up code

* fix tests

* Apply suggestions from code review

Co-authored-by: Eric Nordelo <[email protected]>

* fix tests

* change StorageTrait to InternalTrait

* start refactor

* change impls to external fns

* use IOwnableCamelOnly

* fix tests

* remove unneeded mut

* remove unneeded mut

* Apply suggestions from code review

Co-authored-by: Eric Nordelo <[email protected]>

* change to TState

* fix formatting

* remove Ownable prefix in fn calls

* remove internal owner fn

* use internal state trait to read owner

---------

Co-authored-by: Eric Nordelo <[email protected]>

* Migrate ERC20 to Cairo 2 (#669)

* feat: fix tests

* feat: apply review updates

* Migrate access control to cairo2 (#668)

* bump to cairo v2.0.2

* update Cargo

* comment out mods

* update initializable syntax

* move security tests

* update initializable tests

* fix formatting

* remove SpanSerde

* update ownable syntax

* add ownable_camel impl

* update syntax in ownable mocks

* update ownable tests

* fix formatting

* update cairo

* update Cargo

* simplify and clarify tests

* fix formatting

* simplify internal fns

* add initializer

* fix constructor, tidy up code

* fix tests

* Apply suggestions from code review

Co-authored-by: Eric Nordelo <[email protected]>

* fix tests

* change StorageTrait to InternalTrait

* update syntax

* update mocks

* start updating tests

* start refactor

* change impls to external fns

* use IOwnableCamelOnly

* fix tests

* remove unneeded mut

* remove unneeded mut

* fix mocks

* simplify events

* change array syntax

* update syntax in tests

* fix formatting

* Apply suggestions from code review

Co-authored-by: Eric Nordelo <[email protected]>

* add space between events

* fix generic state

* add space between events

* fix formatting

---------

Co-authored-by: Eric Nordelo <[email protected]>

* Migrate to Scarb for cairo-2 (#671)

* Migrate to Scarb

* Hide tests module behind cfg

* Add spdx (#684)

* add spdx

* add spdx

* feat: sort imports (#679)

* Migrate upgrades (#603)

* add upgrades to lib

* add proxy mod

* update cairo

* update Cargo

* fix test command

* add upgrades

* fix spelling

* add upgrade test

* fix spelling

* add upgrade_and_call

* update cairo

* update Cargo

* add events

* tidy up code

* fix format

* update cairo to alpha7

* update Cargo

* fix expected syntax

* fix conflict

* update expected syntax

* formatting

* update cairo to rc0

* update Cargo

* fix import

* refactor mocks

* start test refactor

* simplify upgrades, add upgrade_and_call

* refactor mocks

* refactor upgrades

* refactor tests

* fix imports, add impl

* fix imports

* fix formatting

* add abis to mocks

* refactor tests with dispatchers

* fix formatting

* start migration

* update syntax

* update syntax in mocks

* fix tests

* add line

* remove line

* add upgradeable trait

* replace interface impl with trait impl

* fix formatting

* add assertion

* add tests for events

* Apply suggestions from code review

Co-authored-by: Eric Nordelo <[email protected]>

* move logic to internal impl

* add interface

* update paths

* fix formatting

* simplify imports

* Apply suggestions from code review

Co-authored-by: Eric Nordelo <[email protected]>

* Apply suggestions from code review

Co-authored-by: Martín Triay <[email protected]>

* remove upgrade_and_call, test event in separate test

* remove upgrade_and_call

* remove unused import

* reorder imports, tidy up code

---------

Co-authored-by: Eric Nordelo <[email protected]>
Co-authored-by: Martín Triay <[email protected]>

* Add testing for Ownable events (#675)

* feat: add tests for ownable events

* feat: improve tests

* Update src/tests/utils.cairo

Co-authored-by: Martín Triay <[email protected]>

---------

Co-authored-by: Martín Triay <[email protected]>

* Add account events (#687)

* feat: add tests for ownable events

* define account events

* add event to set_public_key

* add event test

* change param name

* fix event emit param

* fix formatting

* add tests for events

* add default checks in tests

* feat: improve tests

* Apply suggestions from code review

Co-authored-by: Eric Nordelo <[email protected]>

* reorder imports, remove Account prefix

* fix events

* fix formatting

* Update src/tests/utils.cairo

Co-authored-by: Martín Triay <[email protected]>

* add event checks, use ZERO from constants

* fix formatting

---------

Co-authored-by: Eric Nordelo <[email protected]>
Co-authored-by: Martín Triay <[email protected]>

* Add testing for AccessControl events (#674)

* feat: add testing for events

* feat: add tests for ownable events

* feat: improve tests

* feat: apply review updates

* Add testing for Pausable events (#676)

* feat: add testing for events

* feat: add tests for ownable events

* feat: add tests for pausable events

* Update src/openzeppelin/tests/security/test_pausable.cairo

Co-authored-by: Andrew Fleming <[email protected]>

* feat: improve tests

* feat: apply review updates

* feat: apply review updates

---------

Co-authored-by: Andrew Fleming <[email protected]>
Co-authored-by: Martín Triay <[email protected]>

* Add testing for ERC20 events (#677)

* feat: add testing for events

* feat: add tests for ownable events

* feat: add tests for pausable events

* feat: add tests for erc20 events

* Update src/openzeppelin/tests/security/test_pausable.cairo

Co-authored-by: Andrew Fleming <[email protected]>

* feat: apply review updates

* feat: improve tests

* feat: apply review updates

* feat: apply review updates

* feat: apply review updates

---------

Co-authored-by: Andrew Fleming <[email protected]>
Co-authored-by: Martín Triay <[email protected]>

* Add mint to erc721 preset constructor (#700)

* add _mint to constructor

* add constructor assertions

* fix formatting

* Add testing for ERC721 events (#678)

* feat: add testing for events

* feat: add tests for ownable events

* feat: add tests for pausable events

* feat: add tests for erc20 events

* feat: add tests for erc721 events

* Update src/openzeppelin/tests/security/test_pausable.cairo

Co-authored-by: Andrew Fleming <[email protected]>

* feat: apply review updates

* feat: add test helper for events

* feat: improve tests

* feat: apply review updates

* feat: apply review updates

* feat: apply review updates

* feat: apply review updates

* feat: apply review updates

---------

Co-authored-by: Andrew Fleming <[email protected]>

* Update README and fix scarb package (#688)

* update README to cairo-2 and scarb usage. bump scarb package version

* update readme

fix linter issues

fix linter issues

fix linter issues

update readme

* add main to CI

* update readme

* update readme

* rename starknet

* fix linter

* update readme

* Update README.md

Co-authored-by: Andrew Fleming <[email protected]>

* Update README.md

Co-authored-by: Andrew Fleming <[email protected]>

* update CONTRIBUTING

* fix linting

* Update CONTRIBUTING.md

Co-authored-by: Andrew Fleming <[email protected]>

* Update CONTRIBUTING.md

Co-authored-by: Andrew Fleming <[email protected]>

* apply review changes

* fix linter

* fix typo

---------

Co-authored-by: Andrew Fleming <[email protected]>

* Bump scarb and fix dual721 test context (#703)

* bump scarb and cairo version

* fix testing context

---------

Co-authored-by: Martín Triay <[email protected]>

* add rc version (#708)

* remove unused imports (#707)

* Upgrade Cairo version and Scarb version to latest releases (#712)

* 👽️ Update code due to breaking changes

* ⬆️ Upgrade scarb and cairo versions

* 💄 Code format

* bump antora (#715)

* Add selector inline macro/fix `tokenURI` (#724)

* update selectors

* use inline selector

* remove selectors file

* remove import

* fix camel tokenURI

* fix formatting

* re-add selectors mod

* import from selectors mod

* fix formatting

* import selector

* fix: naming convention (#732)

* feat: add Errors modules (#691)

* Update account docs (#709)

* feat: update format and add api

* fix: typo

* feat: add counterfactual deployment doc

* feat: add API entries

* feat: add events

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/guides/deployment.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/guides/deployment.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* feat: update from reviews

* feat: apply review updates

* feat: update docs

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/guides/deployment.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/guides/deployment.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/guides/deployment.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/guides/deployment.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* feat: apply review updates

* fix: account casing

* feat: add headers

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* feat: add link

* feat: move API

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* refactor: update wording

* Update docs/antora.yml

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* feat: apply update reviews

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* refactor: UI

* fix: UI

* feat: focus on SRC6

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* feat: apply review updates

---------

Co-authored-by: Andrew Fleming <[email protected]>
Co-authored-by: Martín Triay <[email protected]>

* Add Interface & Dispatchers docs (#730)

* feat: update format and add api

* fix: typo

* feat: add counterfactual deployment doc

* feat: add API entries

* feat: add events

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/guides/deployment.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/guides/deployment.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* feat: update from reviews

* feat: apply review updates

* feat: update docs

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/guides/deployment.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/guides/deployment.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/guides/deployment.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/guides/deployment.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* feat: apply review updates

* fix: account casing

* feat: add headers

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* feat: add link

* feat: move API

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* refactor: update wording

* Update docs/antora.yml

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* feat: apply update reviews

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* refactor: UI

* fix: UI

* feat: focus on SRC6

* add interface & dispatchers docs

* apply review feedback

* address feedback comments

---------

Co-authored-by: Eric Nordelo <[email protected]>
Co-authored-by: Andrew Fleming <[email protected]>

* Update overview docs (#735)

* feat: update format and add api

* fix: typo

* feat: add counterfactual deployment doc

* feat: add API entries

* feat: add events

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/guides/deployment.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/guides/deployment.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* feat: update from reviews

* feat: apply review updates

* feat: update docs

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/guides/deployment.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/guides/deployment.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/guides/deployment.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/guides/deployment.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* feat: apply review updates

* fix: account casing

* feat: add headers

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* feat: add link

* feat: move API

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* refactor: update wording

* Update docs/antora.yml

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* feat: apply update reviews

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* refactor: UI

* fix: UI

* feat: focus on SRC6

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* feat: update overview

* feat: apply review updates

* Update docs/modules/ROOT/pages/index.adoc

Co-authored-by: Martín Triay <[email protected]>

* feat: apply review updates

* Update docs/modules/ROOT/pages/index.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* feat: apply review updates

* Update docs/modules/ROOT/pages/index.adoc

Co-authored-by: Andrew Fleming <[email protected]>

---------

Co-authored-by: Andrew Fleming <[email protected]>
Co-authored-by: Martín Triay <[email protected]>

* remove underscore from name_ and symbol_ (#738)

* Add prefixes to storage members (#743)

* feat: add prefixes

* Update src/access/accesscontrol/accesscontrol.cairo

Co-authored-by: Andrew Fleming <[email protected]>

---------

Co-authored-by: Andrew Fleming <[email protected]>

* Sanitizing for release. (#736)

* refactor: sanitizing

* feat: sanitizing

* feat: apply review updates

* feat: apply review updates

* Update Access Control docs (#719)

* feat: update format and add api

* fix: typo

* feat: add counterfactual deployment doc

* feat: add API entries

* feat: add events

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/guides/deployment.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/guides/deployment.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* feat: update from reviews

* feat: apply review updates

* feat: update docs

* feat: update docs

* feat: update from account docs

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/guides/deployment.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/guides/deployment.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/guides/deployment.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/guides/deployment.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* feat: apply review updates

* fix: account casing

* feat: add headers

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* feat: add link

* feat: move API

* feat: add event references

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* refactor: update wording

* Update docs/antora.yml

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* feat: apply update reviews

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* refactor: UI

* fix: UI

* feat: focus on SRC6

* Update docs/modules/ROOT/pages/api/access.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/api/access.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/api/access.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/api/access.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* feat: apply review updates

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* feat: apply review updates

* Update docs/modules/ROOT/pages/access.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/access.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/access.adoc

Co-authored-by: Martín Triay <[email protected]>

* feat: apply review updates

* feat: apply review updates

* Update docs/modules/ROOT/pages/api/access.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/access.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/access.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/access.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/access.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/access.adoc

Co-authored-by: Martín Triay <[email protected]>

* feat: apply review updates

* feat: remove sn_keccak in comments

* feat: replace cairo-2 with replace-0.7.0

* feat: remove grayed-out areas

* Update docs/modules/ROOT/pages/access.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/api/access.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/api/access.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/api/access.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/api/access.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/api/access.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* feat: apply review updates

* Update docs/modules/ROOT/pages/access.adoc

Co-authored-by: Andrew Fleming <[email protected]>

---------

Co-authored-by: Andrew Fleming <[email protected]>
Co-authored-by: Martín Triay <[email protected]>

* Add indexed keys to token events (#746)

* add indexed keys to events

* fix event assertions

* use pop_log from utils

* fix formatting

* remove event id from keys

* remove PartialEq from events

* revert event assertion changes

* fix sentence

* remove extra line

* fix comment

* add assert_indexed_keys

* apply assert_indexed_keys to tests

* fix formatting

* tidy up code

* Apply suggestions from code review

Co-authored-by: Martín Triay <[email protected]>

* remove import

---------

Co-authored-by: Martín Triay <[email protected]>

* Update Introspection docs (#721)

* feat: update format and add api

* fix: typo

* feat: add counterfactual deployment doc

* feat: add API entries

* feat: add events

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/guides/deployment.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/guides/deployment.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* feat: update from reviews

* feat: apply review updates

* feat: update docs

* feat: update docs

* feat: update from account docs

* feat: update main page

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/guides/deployment.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/guides/deployment.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/guides/deployment.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/guides/deployment.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* feat: apply review updates

* fix: account casing

* feat: add headers

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* feat: add link

* feat: move API

* feat: add event references

* feat: update API

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* refactor: update wording

* Update docs/antora.yml

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* feat: apply update reviews

* Update docs/modules/ROOT/pages/api/account.adoc

Co-authored-by: Martín Triay <[email protected]>

* refactor: UI

* fix: UI

* feat: focus on SRC6

* Update docs/modules/ROOT/pages/api/access.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/api/access.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/api/access.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/api/access.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* feat: apply review updates

* Update docs/modules/ROOT/pages/introspection.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/introspection.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/introspection.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/introspection.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/introspection.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/introspection.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/api/introspection.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/accounts.adoc

Co-authored-by: Martín Triay <[email protected]>

* feat: apply review updates

* Update docs/modules/ROOT/pages/access.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/access.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/access.adoc

Co-authored-by: Martín Triay <[email protected]>

* feat: apply review updates

* Update docs/modules/ROOT/pages/introspection.adoc

Co-authored-by: Martín Triay <[email protected]>

*…
  • Loading branch information
8 people authored Sep 29, 2023
1 parent 4dd0425 commit eb26682
Show file tree
Hide file tree
Showing 216 changed files with 11,808 additions and 15,819 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
*.cairo linguist-language=python
*.cairo linguist-language=rust
52 changes: 0 additions & 52 deletions .github/workflows/coverage.yml

This file was deleted.

41 changes: 0 additions & 41 deletions .github/workflows/release.yml

This file was deleted.

57 changes: 22 additions & 35 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,31 @@
name: Test
name: Lint and test

on:
pull_request:
branches:
- main
- cairo-2
push:
tags:
- "v*"
branches:
- main
- cairo-2

jobs:
validate:
lint_and_test:
name: Lint and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Get commits
id: commits
run: |
echo "MAIN=$(git show -s --format="%H" origin/main)" >> $GITHUB_OUTPUT
echo "TAG=$(git rev-list -n 1 ${GITHUB_REF#refs/*/})" >> $GITHUB_OUTPUT
- name: Print commits
run: |
echo "Main commit: ${{ steps.commits.outputs.MAIN }}"
echo "Tag commit: ${{ steps.commits.outputs.TAG }}"
- name: Compare commits
if: ${{ steps.commits.outputs.MAIN != steps.commits.outputs.TAG }}
uses: actions/github-script@d556feaca394842dc55e4734bf3bb9f685482fa0 # v6.3.3
- uses: actions/checkout@v3
- uses: software-mansion/setup-scarb@v1
with:
script: |
core.setFailed('Tagged commit does not match main')
test:
runs-on: ubuntu-latest
needs: [validate]
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
scarb-version: "0.7.0"
- name: Markdown lint
uses: DavidAnson/markdownlint-cli2-action@5b7c9f74fec47e6b15667b2cc23c63dff11e449e # v9
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest tox
- name: Run tests
run: |
tox
globs: |
*.md
!PULL_REQUEST_TEMPLATE.md
- name: Cairo lint
run: scarb fmt --check
- name: Cairo test
run: scarb test
11 changes: 7 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
artifacts/
.DS_Store

# Cairo 1
corelib/

# Scarb
target/

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down Expand Up @@ -73,9 +79,6 @@ instance/
# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "cairo"]
path = cairo
url = https://github.com/starkware-libs/cairo.git
5 changes: 5 additions & 0 deletions .markdownlint.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
// Disable line length check to enable paragraphs without internal line breaks.
// See https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md013---line-length
"MD013": false
}
8 changes: 0 additions & 8 deletions .markdownlintrc

This file was deleted.

91 changes: 14 additions & 77 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,69 +6,11 @@ We really appreciate and value contributions to OpenZeppelin Contracts for Cairo

Before starting development, please [create an issue](https://github.com/OpenZeppelin/cairo-contracts/issues/new/choose) to open the discussion, validate that the PR is wanted, and coordinate overall implementation details.

Also, consider that snake case is used for Cairo development in general due to its strong Python bias.
This project follows our [Extensibility pattern](https://docs.openzeppelin.com/contracts-cairo/extensibility), camelCasing all exposed function names and their parameters:

```cairo
@external
func exposedFunc(paramOne, paramTwo){
}
```

All internal and otherwise unexposed functions should resort to snake_case:

```cairo
func internal_func(param_one, param_two){
}
```

Compare our preset contracts with the libraries from which they're derived such as the [ERC20 preset](./src/openzeppelin/token/erc20/presets/ERC20.cairo) and [ERC20 library](./src/openzeppelin/token/erc20/presets/ERC20.cairo) for full examples.
See [Function names and coding style](https://docs.openzeppelin.com/contracts-cairo/0.4.0/extensibility#function_names_and_coding_style) for more information.

And make sure to always include tests and documentation for the new developments. Please consider the following conventions:

- Naming
- Libraries should be named `library.cairo`, e.g. `erc20/library.cairo`
- Contracts should be PascalCased i.e. `MyContract.cairo`
- Interfaces should be prefixed with an `I`, as in `IAccount.cairo`
- Test modules should begin with `test_` followed by the contract name i.e. `test_MyContract.py`

- Structure
- Libraries should cede their names to their parent directory and are named `library.cairo` instead
- Interfaces should be alongside the library that the interface defines
- Preset contracts should be within a `presets` directory of the library to which they are a preset
- Here are example paths:
- `openzeppelin.token.erc20.library`
- `openzeppelin.token.erc20.IERC20`
- `openzeppelin.token.erc20.presets.ERC20Mintable`
- And a visual guide:

```python
openzeppelin
└──token
└── erc20
├── library.cairo
├── IERC20.cairo
└── presets
└── ERC20Mintable.cairo
```

- Preset contract testing
- Though, inheritance is not possible in Cairo, this repo utilizes inheritance for testing. This proves useful for testing multiple contracts that stem from the same base library. For example, the preset contracts [ERC20Mintable](./src/openzeppelin/token/erc20/presets/ERC20Mintable.cairo) and [ERC20Burnable](./src/openzeppelin/token/erc20/presets/ERC20Burnable.cairo) both share the base ERC20 functionality. To reduce code repetition, we follow these guidelines:
- `BaseSuites`
- module names are not prefixed with `test_`
- set base tests inside a class
- class name should not be prefixed with `Test`; otherwise, these tests run twice

- test modules
- define the base fixture (`contract_factory`) and any other fixtures not used in the base suite i.e. `erc721_minted`
- define the test class and inherit the base class i.e. `class TestERC20(OwnableBase)`
- add tests specific to the preset flavor within the test class

- fixtures
- are not defined in the base suite but are passed, unpacked, and used
- are defined in the tests where they are used
- for modularity, the basic contract factory fixture is always called `contract_factory`
### Coding style

After a few radical changes in the Cairo language (mainly the transition to Cairo 1), our coding style guidelines became automatically deprecated.
That's why [we're working on setting new ones](https://github.com/OpenZeppelin/cairo-contracts/issues/696).
Feel free to read, contribute, discuss, and ask questions in the issue.

## Creating Pull Requests (PRs)

Expand Down Expand Up @@ -98,32 +40,29 @@ As a contributor, you are expected to fork this repository, work on your own for
3. Make your changes, add your files, update documentation ([see Documentation section](#documentation)), commit, and push to your fork.

```sh
git add SomeFile.js
git add src/file.cairo
git commit "Fix some bug short description #123"
git push origin fix/some-bug-short-description-#123
```

4. Run tests, linter, etc. This can be done by running local continuous integration and make sure it passes. We recommend to use a [python virtual environment](https://docs.python.org/3/tutorial/venv.html).
4. Run tests and linter. This can be done by running local continuous integration and make sure it passes.

```bash
# install tox from testing dependencies
pip install .[testing] # '.[testing]' in zsh
# run tests
tox
scarb test
# stop the build if there are Markdown documentation errors
tox -e lint
# run linter
scarb fmt --check
```

5. Go to [github.com/OpenZeppelin/cairo-contracts](https://github.com/OpenZeppelin/cairo-contracts) in your web browser and issue a new pull request.
5. Go to [OpenZeppelin/cairo-contracts](https://github.com/OpenZeppelin/cairo-contracts) in your web browser and issue a new pull request.
Begin the body of the PR with "Fixes #123" or "Resolves #123" to link the PR to the issue that it is resolving.
*IMPORTANT* Read the PR template very carefully and make sure to follow all the instructions. These instructions
refer to some very important conditions that your PR must meet in order to be accepted, such as making sure that all PR checks pass.

6. Maintainers will review your code and possibly ask for changes before your code is pulled in to the main repository. We'll check that all tests pass, review the coding style, and check for general code correctness. If everything is OK, we'll merge your pull request and your code will be part of OpenZeppelin Contracts for Cairo.

*IMPORTANT* Please pay attention to the maintainer's feedback, since its a necessary step to keep up with the standards OpenZeppelin Contracts attains to.
*IMPORTANT* Please pay attention to the maintainer's feedback, since it's a necessary step to keep up with the standards OpenZeppelin Contracts attains to.

## Documentation

Expand All @@ -145,15 +84,13 @@ If you want to run the documentation UI locally:

## Integration tests

Currently, [starknet's test suite](https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/testing/starknet.py) has important differences with public networks. Like [not checking signature hints toward the end of the tx flow](https://github.com/OpenZeppelin/cairo-contracts/issues/386).

That's why we strongly suggest testing new features against a testnet before submitting the PR, to make sure that everything works as expected in a real environment.
Currently, Starknet's test suite has important differences with public networks. We strongly suggest testing new features against a testnet before submitting the PR, to make sure that everything works as expected in a real environment.
We are looking into defining a better process for these integration tests, but for now the PR author/contributor must suggest an approach to test the feature when applicable, which has to be agreed and reproduced by the reviewer.
## All set
If you have any questions, feel free to post them to github.com/OpenZeppelin/cairo-contracts/issues.
If you have any questions, feel free to post them as an [issue](https://github.com/OpenZeppelin/cairo-contracts/issues).
Finally, if you're looking to collaborate and want to find easy tasks to start, look at the issues we marked as ["Good first issue"](https://github.com/OpenZeppelin/cairo-contracts/labels/good%20first%20issue).

Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in

This file was deleted.

1 change: 0 additions & 1 deletion PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Fixes #??? <!-- Fill in with issue number -->
<!-- Describe the changes introduced in this pull request. -->
<!-- Include any context necessary for understanding the PR's purpose. -->


#### PR Checklist

<!-- Before merging the pull request all of the following must be complete. -->
Expand Down
Loading

0 comments on commit eb26682

Please sign in to comment.