hashgraph / hedera-smart-contracts

Contains Hedera Smart Contract Service supporting files
Apache License 2.0
37 stars 50 forks source link

feat: added cryptoTransfer to CryptoAllowance to showcase support in HIP906 #800

Closed quiet-node closed 2 weeks ago

quiet-node commented 3 weeks ago

Description:

Related issue(s):

Fixes #797

Notes for reviewer:

Checklist

github-actions[bot] commented 3 weeks ago

Test Results

  17 files  +  3    86 suites  +16   7m 54s :stopwatch: + 1m 18s 254 tests +19  246 :heavy_check_mark: +17    7 :zzz: +1  1 :x: +1  286 runs  +51  275 :heavy_check_mark: +46  10 :zzz: +4  1 :x: +1 

For more details on these failures, see this check.

Results for commit 18f09007. ± Comparison against base commit 024064d7.

:recycle: This comment has been updated with latest results.

quiet-node commented 2 weeks ago

overall looks good, leaved some nits and comments.

Also, I would like to see the test cases defined as:

  1. Grant Allowance (approve) from EOA to EOA
  2. Grant Allowance (approve) from EOA to Contract
  3. Grant Allowance (approve) from Contract to EOA
  4. Grant Allowance (approve) from Contract to Contract
  5. Get Current Allowance from owner account to another Account
  6. Get Current Allowance from owner account to an Smart Contract

I also think that the correct resolution of these scenarios will need for the EOA to call the system contract directly. due to Security model limitations.

Finally, not sure why are we adding this examples and tests as part of the HTS-Precompile folder, since is not related to HTS transfers but I would place it in its own folder called HAS-SystemContract (Hedera Account Service System Contract)

@AlfredoG87

  1. Grant Allowance (approve) from EOA to EOA

  2. Grant Allowance (approve) from EOA to Contract

  3. Grant Allowance (approve) from Contract to EOA

  4. Grant Allowance (approve) from Contract to Contract

  5. Get Current Allowance from owner account to another Account

  6. Get Current Allowance from owner account to an Smart Contract