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: assign contract owner upon contract deployment #403

Merged
merged 8 commits into from
Nov 30, 2022

Conversation

piux2
Copy link
Contributor

@piux2 piux2 commented Nov 29, 2022

The issue to fix:

There is a bug that prevents us from assigning the contract deployer as the contract owner. VM panics on a non-pointer interface error when we try to deploy a contract where we put the caller as contract owner in the init() function. The contract admin address is hardcoded in many contract examples as a workaround

Cause:
It turns out AddPackage does not set VM ExecContext in Keeper.

Two People Review Needed: Yes
Since the fix modifies vm/keeper.go, an extensive review is needed.

@moul moul changed the title Critical fix. Assign contract owner upon contract deployment. fix: assign contract owner upon contract deployment Nov 29, 2022
pkgs/sdk/vm/keeper_test.go Outdated Show resolved Hide resolved
pkgs/sdk/vm/keeper_test.go Outdated Show resolved Hide resolved
pkgs/sdk/vm/keeper_test.go Outdated Show resolved Hide resolved
pkgs/sdk/vm/keeper_test.go Outdated Show resolved Hide resolved
pkgs/sdk/vm/keeper_test.go Outdated Show resolved Hide resolved
piux2 and others added 5 commits November 29, 2022 01:13
Co-authored-by: Manfred Touron <94029+moul@users.noreply.github.com>
Co-authored-by: Manfred Touron <94029+moul@users.noreply.github.com>
Co-authored-by: Manfred Touron <94029+moul@users.noreply.github.com>
Co-authored-by: Manfred Touron <94029+moul@users.noreply.github.com>
Co-authored-by: Manfred Touron <94029+moul@users.noreply.github.com>
@anarcher
Copy link
Contributor

LGTM

@piux2
Copy link
Contributor Author

piux2 commented Nov 29, 2022

LGTM

Thank you @anarcher

@moul moul merged commit fc53df2 into gnolang:master Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

3 participants