Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

feat(meta_contract): batch create eth accounts #121

Conversation

zeroqn
Copy link
Contributor

@zeroqn zeroqn commented May 30, 2022

@zeroqn zeroqn requested a review from jjyr as a code owner May 30, 2022 09:52
@Flouse Flouse added the enhancement New feature or request label Jul 5, 2022
c/contracts/meta_contract.c Outdated Show resolved Hide resolved
@@ -109,7 +109,10 @@ int main() {
_gw_fast_memcpy((uint8_t *)(&fee_amount), (uint8_t *)amount_seg.ptr,
sizeof(uint128_t));

uint32_t reg_id = *(uint32_t *)reg_id_seg.ptr;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In c/contracts dir, there are some other places used this kind of scheme.

c/contracts/eth_addr_reg.c:
  108      mol_seg_t reg_id_seg = MolReader_Fee_get_registry_id(&fee_seg);
  109:     uint32_t reg_id = *(uint32_t *)reg_id_seg.ptr;
  110  

  141      mol_seg_t reg_id_seg = MolReader_Fee_get_registry_id(&fee_seg);
  142:     uint32_t reg_id = *(uint32_t *)reg_id_seg.ptr;
  143  

c/contracts/meta_contract.c:
   81  
   82:     uint32_t reg_id = *(uint32_t *)reg_id_seg.ptr;
   83      ret = handle_fee(&ctx, reg_id, fee_amount);

  111  
  112:     uint32_t reg_id = *(uint32_t *)reg_id_seg.ptr;
  113      ret = handle_fee(&ctx, reg_id, fee_amount);

c/contracts/sudt.c:
  91  
  92:     uint32_t reg_id = *(uint32_t *)fee_reg_seg.ptr;
  93      uint32_t from_id = ctx.transaction_context.from_id;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can fix these in different pr.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jjyr jjyr merged commit cd5068c into godwokenrises:master Jul 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants