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: Upgradeables Contracts (both SN and ETH) #120

Merged
merged 50 commits into from
Jan 30, 2024
Merged

feat: Upgradeables Contracts (both SN and ETH) #120

merged 50 commits into from
Jan 30, 2024

Conversation

uri-99
Copy link
Collaborator

@uri-99 uri-99 commented Jan 24, 2024

This PR merges branch Upgradeables into Main.
Branch upgradeables has both ETH upgradeable and SN upgradeable.
Also:

  • SN Upgradeable has implemented "SN Pausable".
  • ETH Upgradeable has implemented "Restrict access to YABTransfer, only allow MM"

dubzn and others added 30 commits January 15, 2024 14:01
* forge install: openzeppelin-contracts

v5.0.1

* apply upgradeable to eth contract (wip)

* upgradeable with script (wip)

* forge install: openzeppelin-foundry-upgrades

* forge install: openzeppelin-contracts-upgradeable

v5.0.1

* continue test (still not working)

* upgradeable eth working

* fix upgrade.sh + env.example

* extract initialize variables to envs

* remove verbose from upgrade script

* refactor Upgrade.s.sol + YABTransfer

* fix makefile commands

* remove SN_ESCROW_ADDRESS from envs

* add upgrade eth to README

* remove hardcoded values in .env.example

* remove comment for mm-bot

* resolve comments

* revert changes

* Update .env.example

* forge install: openzeppelin-contracts

v5.0.1

* forge install: openzeppelin-contracts-upgradeable

v5.0.1

* remove unused dependencies .gitsubmodules

* forge install: openzeppelin-contracts-upgradeable

v5.0.1

* minor issues

* fix wrong env upgrade.sh

* add step for auto-update .env with proxy address

* remove ETH_PRIVATE_KEY from scripts

* read env using source

* refactor dependencies

* README - add YAB_TRANSFER_PROXY_ADDRESS to deploy section

* rm openzeppelin-contracts-upgradeable

* minor change
* Starknet escrow script + make build, clean & test

* add ethereum escrow deploy + documentation

* rename commands Makefile

* update makefile + readme

* fix makefile clean commands

* OZ dependency + escrow impl

* fix import

* forge install: openzeppelin-contracts

v5.0.1

* fix feedback comments

* fix wrong env name (thx @uri-99)

* refactor deploy.sh + add upgrade.sh (wip)

* refactor deploy.sh & upgrade.sh

* add EscrowV2 for test upgradeable

* add upgradeable tests

* revert method name changes

* fix upgrade.sh + refactor

* rename SN_PROXY_ESCROW_ADDRESS to SN_ESCROW_ADDRESS

* fix deploy error + change upgrade log

* eof

* update readme

* revert solidity files changes

* remove "proxy" from echo

* rename starknet rpc env

* resolve comments

* remove openzeppelin-contracts

* rename and move EscrowV2

* fix feedback comments

* update README

* revert .gitmodules change
* feat: escrow contract without herodotus

* fix: change ethereum withrawer in mm_bot

* feat: upgreadable Escrow_herodotus contract

* refactor: readme with herodotus

* refactor: remove comment

* refactor: add tmp solution disclaimer on readme

* refactor: rename starknet escrow contract

* refactor: update wording README.md

Co-authored-by: urimihura <[email protected]>

* refactor: remove transfer.sh

* fix: lowercase escrow module

---------

Co-authored-by: urimihura <[email protected]>
Uriel Mihura and others added 9 commits January 19, 2024 17:47
* start new branch

* Add MMAddress filter

* WIP debugging _MM not initialized

* WIP debugging _MM

* fix: change transfer test to proxy format

* refactor: mm variable rename to comply with format

* prettier ACL and tests

* tidy ACL test

* more transfer tests

* test withdraw WIP

* Fix PR comments

* refactor: address creation in tests

* Test: withdraw function

* fix: remove restriction to getMMAddress

* fix: test addr creation

* fix: test names

* fix: tests

* fix: test mock value

* Update contracts/solidity/test/Transfer.sol

Co-authored-by: Santos Rosati <[email protected]>

* Update contracts/solidity/test/Transfer.sol

Co-authored-by: Santos Rosati <[email protected]>

* fix: mock call to L2

---------

Co-authored-by: Uriel Mihura <[email protected]>
Co-authored-by: rcatalan98 <[email protected]>
Co-authored-by: Santos Rosati <[email protected]>
* start branch

* pausable impl start

* fix + test: pausable

* test: more for pause()

* Test: upgrade when paused

* Update contracts/cairo/src/tests/test_escrow.cairo

Co-authored-by: Roberto J Catalan <[email protected]>

* test: L1 handler calling

* fix: remove unpause from constructor

* Update contracts/cairo/src/tests/test_escrow.cairo

Co-authored-by: Roberto J Catalan <[email protected]>

* Update contracts/cairo/src/tests/test_escrow.cairo

Co-authored-by: Roberto J Catalan <[email protected]>

* test: improve call_l1_from_user

* fix: test names

* fix: remove comment

---------

Co-authored-by: Uriel Mihura <[email protected]>
Co-authored-by: Roberto J Catalan <[email protected]>
Co-authored-by: Uriel Mihura <[email protected]>
Co-authored-by: Uriel Mihura <[email protected]>
Uriel Mihura and others added 7 commits January 29, 2024 11:47
* refactor: deployment scripts to avoid errors

* fix: add param for contract addr missing

* fix: use . instead of source

* fix: run starknet-build on starknet-deploy-and-connect

* refactor: both deploys and 'make deploy-all' , now setting envs

* style: turn off "echo command" in make

* feat: same refactor for upgrade in eth

* feat: same refactor of env usage for cairo deploy

* fix: make starknet-test import

* fix: make eth-set-escrow + eth-set-withdraw-selector

* Fix: various fixes on desc of this commit

 updated .env.example
.sh colored prints for mac
 check required var is declared on set_escrow.sh
hint to export appropriate var after ethereum-deploy

* fix: color prints, and change purple to cyan

* fix: usage of printf in .sh

* feat: add reminder to finish config after cairo deploy

* style: add \n to printed reminder

* feat: display relevant info after deploy-all

* style: remove unnecessary imports + small prints

* style: printed info after make-all

* style: remove unnecesary comments

* style: \n at EOFs

---------

Co-authored-by: Julián Arce <[email protected]>
Co-authored-by: Uriel Mihura <[email protected]>
@uri-99 uri-99 marked this pull request as ready for review January 30, 2024 18:05
Uriel Mihura added 3 commits January 30, 2024 15:23
contracts/cairo/upgrade.sh Outdated Show resolved Hide resolved
@uri-99 uri-99 merged commit 17445e1 into main Jan 30, 2024
@uri-99 uri-99 deleted the upgradeables branch January 30, 2024 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants