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 begin_chain function to contract #1

Closed
frankbraun opened this issue Mar 9, 2021 · 6 comments
Closed

Add begin_chain function to contract #1

frankbraun opened this issue Mar 9, 2021 · 6 comments
Assignees
Labels
C-enhancement Category: New feature or request

Comments

@frankbraun
Copy link
Contributor

For the evm-bully we need a begin_chain function.
The function should allow to set the account balances in the genesis state and should only be available in a testing version of the contract.

artob added a commit that referenced this issue Mar 9, 2021
@artob artob changed the title Add begin_chain function to EVM smart contract Add begin_chain function to contract Mar 10, 2021
artob added a commit that referenced this issue Mar 12, 2021
@artob
Copy link
Contributor

artob commented Mar 12, 2021

@frankbraun Commit 526005d added an initial parameter definition for begin_chain:

/// Borsh-encoded parameters for the `begin_chain` function.
#[derive(BorshSerialize, BorshDeserialize)]
pub struct BeginChainArgs {
pub chain_id: RawU256,
}

Note that the input to the begin_chain function is Borsh-encoded, not JSON-encoded.

I'm still working on figuring out a workable Borsh encoding for setting genesis block balances.

Meanwhile, if more scalar parameters beyond chain_id are needed, add them in a PR.

@frankbraun
Copy link
Contributor Author

This needs to be put behind a feature flag and, as @ilblackdragon noted, should only be callable by the owner.

@artob: You mentioned that you already have some code for this?

@artob
Copy link
Contributor

artob commented Mar 29, 2021

@artob: You mentioned that you already have some code for this?

I've restored the basic begin_chain functionality in 1458997. It had broken when #6 was merged.

@joshuajbouw
Copy link
Contributor

Isn't this closed now?

@artob
Copy link
Contributor

artob commented May 12, 2021

@frankbraun Can this be closed? Please close issues when they are done.

@frankbraun
Copy link
Contributor Author

Sorry, this got buried in GitHub notifications.

aleksuss added a commit that referenced this issue Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants