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

Add calling scripthash check to native nep5 transfers #1180

Merged
merged 2 commits into from
Jul 16, 2020

Conversation

roman-khimov
Copy link
Member

Problem

It's impossible to transfer native assets from contract's address. And we have nasty old #924.

Solution

Add caller check to transfer and deal with script hash getters.

All scripts are run in VM, so it's there to tell us about script hashes
involved and it must be used instead of nep5ScriptHash kludge.
@roman-khimov roman-khimov added the bug Something isn't working label Jul 15, 2020
@roman-khimov roman-khimov added this to the v0.91.0 milestone Jul 15, 2020
@codecov
Copy link

codecov bot commented Jul 15, 2020

Codecov Report

Merging #1180 into master will increase coverage by 0.04%.
The diff coverage is 50.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1180      +/-   ##
==========================================
+ Coverage   66.71%   66.75%   +0.04%     
==========================================
  Files         198      198              
  Lines       16802    16787      -15     
==========================================
- Hits        11210    11207       -3     
+ Misses       4995     4983      -12     
  Partials      597      597              
Impacted Files Coverage Δ
pkg/core/interop/context.go 100.00% <ø> (ø)
pkg/core/native/native_neo.go 35.78% <0.00%> (+0.47%) ⬆️
pkg/core/native/native_nep5.go 71.02% <42.85%> (-0.18%) ⬇️
pkg/core/interop/runtime/witness.go 40.35% <50.00%> (ø)
pkg/core/interops.go 100.00% <100.00%> (ø)
pkg/core/native/policy.go 70.58% <100.00%> (-0.46%) ⬇️
pkg/vm/vm.go 88.30% <0.00%> (+0.38%) ⬆️
pkg/rpc/client/wsclient.go 84.56% <0.00%> (+1.34%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aee2007...59be6bc. Read the comment docs.

@roman-khimov roman-khimov merged commit acfded7 into master Jul 16, 2020
@roman-khimov roman-khimov deleted the fix-calling-scripthash-check-in-nep5 branch July 16, 2020 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants