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

refactor(cketh/ckerc20): mark older helper smart contracts as deprecated #2747

Merged
merged 5 commits into from
Nov 22, 2024

Conversation

gregorydemay
Copy link
Member

@gregorydemay gregorydemay commented Nov 21, 2024

The helper smart contract supporting subaccount is the new preferred way to do deposit, both of ETH and ERC-20. The 2 previous helper smart contracts are therefore deprecated. Concretely,

  1. The status (active or deprecated) of a helper smart contract is added to the minter dashboard.
  2. In case the address of the helper smart contract supporting subaccount is set, the minter endpoints to retrieve the state of a scraping (contract address and last scraped block number) for deposit of ETH and ERC-20 will be that of the new helper smart contract supporting subaccount.
  3. The field last_deposit_with_subaccount_scraped_block_number was removed. This is not a breaking change since it was never deployed in production.

@gregorydemay gregorydemay marked this pull request as ready for review November 21, 2024 15:14
@gregorydemay gregorydemay requested a review from a team as a code owner November 21, 2024 15:14
@gregorydemay gregorydemay requested review from ninegua and THLO November 21, 2024 15:14
@gregorydemay gregorydemay added this pull request to the merge queue Nov 22, 2024
Merged via the queue into master with commit 2181ddf Nov 22, 2024
29 checks passed
@gregorydemay gregorydemay deleted the gdemay/XC-227-deprecate-older-smart-contracts branch November 22, 2024 13:10
github-merge-queue bot pushed a commit that referenced this pull request Nov 30, 2024
Fix an undesired breaking changed introduced by #2747 :

1. The fields `eth_helper_contract_address` and
`erc20_helper_contract_address` in `get_minter_info` were wrongly reused
to point to the new helper smart contract
[0x18901044688D3756C35Ed2b36D93e6a5B8e00E68](https://etherscan.io/address/0x18901044688D3756C35Ed2b36D93e6a5B8e00E68)
that supports deposit with subaccounts and that was added as part of
proposal
[134264](https://dashboard.internetcomputer.org/proposal/134264).
2. This broke clients that relied on that information to make deposit of
ETH or ERC-20 because the new helper smart contract has a different ABI.
This is visible by such a
[transaction](https://etherscan.io/tx/0x0968b25814221719bf966cf4bbd2de8290ed2ab42c049d451d64e46812d1574e),
where the transaction tried to call the method `deposit` (`0xb214faa5`)
that does exist on the [deprecated ETH helper smart
contract](https://etherscan.io/address/0x7574eB42cA208A4f6960ECCAfDF186D627dCC175)
but doesn't on the new contract (it should have been `depositEth`
(`0x17c819c4`)).
3. The fix simply consists in reverting the changes regarding the values
of the fields `eth_helper_contract_address` and
`erc20_helper_contract_address` in `get_minter_info` (so that they point
back to
[0x7574eB42cA208A4f6960ECCAfDF186D627dCC175](https://etherscan.io/address/0x7574eB42cA208A4f6960ECCAfDF186D627dCC175)
and
[0x6abDA0438307733FC299e9C229FD3cc074bD8cC0](https://etherscan.io/address/0x6abDA0438307733FC299e9C229FD3cc074bD8cC0),
respectively) and adding new fields to contain the state of the log
scraping (address and last scraped block number) for the new helper
smart contract.

---------

Co-authored-by: Thomas Locher <thomas.locher@dfinity.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants