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

fix check_supplements assert error #72

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

YadominJinta
Copy link

shelve.open may create db with extension, on Windows, it creates abi_db.shelve.dat, and abi_path().is_file() will always be False.

Refer: https://docs.python.org/3/library/shelve.html#shelve.open
Fix #61

@srbaeza-ai
Copy link

#72

@EasonC13
Copy link

Thank you for fixing this! Hope this can be merged soon!

@srbaeza-ai
Copy link

👍

@EasonC13
Copy link

@YadominJinta Thank you for your work.
I tried to install your package and run it, but it stuck at Running light execution to find functions.
Can you check it out?

> WEB3_PROVIDER_URI=https://eth.llamarpc.com panoramix 0x49091eeaf9A713daBcD0B96D4C12749B218A52a0

2024-02-22 05:50:44,530 HOST panoramix.loader[2685642] INFO Fetching code for 0x49091eeaf9a713dabcd0b96d4c12749b218a52a0...
2024-02-22 05:50:46,944 HOST panoramix.decompiler[2685642] INFO Running light execution to find functions.

@srbaeza-ai
Copy link

#72

@srbaeza-ai
Copy link

I'm going to work on it I'll get back to you

@YadominJinta
Copy link
Author

@EasonC13 if you're using powershell, try

$env:WEB3_PROVIDER_URI="https://eth.llamarpc.com"
panoramix 0x49091eeaf9A713daBcD0B96D4C12749B218A52a0

I just fixed the shelve db problem, but this decompiler still have a lot of compatible problems with Windows, so I suggest using WSL if you need it.

Copy link

@Dioliode Dioliode left a comment

Choose a reason for hiding this comment

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

DioX

Copy link

@Dioliode Dioliode left a comment

Choose a reason for hiding this comment

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

OdiX

Copy link

@Dioliode Dioliode left a comment

Choose a reason for hiding this comment

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

DioX

Copy link

@sara710944 sara710944 left a comment

Choose a reason for hiding this comment

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

`# Palkeoramix decompiler.

def storage:
balanceOf is mapping of uint256 at storage 0
allowance is mapping of uint256 at storage 1
totalSupply is uint256 at storage 2
stor3 is mapping of uint8 at storage 3
paused is uint8 at storage 4
name is array of uint256 at storage 5
symbol is array of uint256 at storage 6
decimals is uint8 at storage 7

def name() payable:
return name[0 len name.length]

def totalSupply() payable:
return totalSupply

def decimals() payable:
return decimals

def isPauser(address _account) payable:
require calldata.size - 4 >= 32
require _account
return bool(stor3[addr(_account)])

def paused() payable:
return bool(paused)

def balanceOf(address _owner) payable:
require calldata.size - 4 >= 32
return balanceOf[addr(_owner)]

def symbol() payable:
return symbol[0 len symbol.length]

def allowance(address _owner, address _spender) payable:
require calldata.size - 4 >= 64
return allowance[addr(_owner)][addr(_spender)]

Regular functions

def _fallback() payable: # default function
revert

def unpause() payable:
require caller
require stor3[caller]
require paused
paused = 0
log Unpaused(address account=caller)

def pause() payable:
require caller
require stor3[caller]
require not paused
paused = 1
log Paused(address account=caller)

def renouncePauser() payable:
require caller
require stor3[caller]
stor3[caller] = 0
log PauserRemoved(address account=caller)

def addPauser(address _account) payable:
require calldata.size - 4 >= 32
require caller
require stor3[caller]
require _account
require not stor3[addr(_account)]
stor3[addr(_account)] = 1
log PauserAdded(address account=_account)

def approve(address _spender, uint256 _value) payable:
require calldata.size - 4 >= 64
require not paused
require _spender
allowance[caller][addr(_spender)] = _value
log Approval(
address tokenOwner=_value,
address spender=caller,
uint256 tokens=_spender)
return 1

def decreaseAllowance(address _spender, uint256 _subtractedValue) payable:
require calldata.size - 4 >= 64
require not paused
require _spender
require _subtractedValue <= allowance[caller][addr(_spender)]
allowance[caller][addr(_spender)] -= _subtractedValue
log Approval(
address tokenOwner=(allowance[caller][addr(_spender)] - _subtractedValue),
address spender=caller,
uint256 tokens=_spender)
return 1

def transfer(address _to, uint256 _value) payable:
require calldata.size - 4 >= 64
require not paused
require _to
require _value <= balanceOf[caller]
balanceOf[caller] -= _value
require _value + balanceOf[_to] >= balanceOf[_to]
balanceOf[addr(_to)] = _value + balanceOf[_to]
log Transfer(
address from=_value,
address to=caller,
uint256 tokens=_to)
return 1

def increaseAllowance(address _spender, uint256 _addedValue) payable:
require calldata.size - 4 >= 64
require not paused
require _spender
require _addedValue + allowance[caller][addr(_spender)] >= allowance[caller][addr(_spender)]
allowance[caller][addr(_spender)] += _addedValue
log Approval(
address tokenOwner=(_addedValue + allowance[caller][addr(_spender)]),
address spender=caller,
uint256 tokens=_spender)
return 1

def transferFrom(address _from, address _to, uint256 _value) payable:
require calldata.size - 4 >= 96
require not paused
require _value <= allowance[addr(_from)][caller]
allowance[addr(_from)][caller] -= _value
require _to
require _value <= balanceOf[addr(_from)]
balanceOf[addr(_from)] -= _value
require _value + balanceOf[_to] >= balanceOf[_to]
balanceOf[addr(_to)] = _value + balanceOf[_to]
log Transfer(
address from=_value,
address to=_from,
uint256 tokens=_to)
log Approval(
address tokenOwner=allowance[addr(_from)][caller],
address spender=_from,
uint256 tokens=caller)
return 1

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AssertionError
5 participants