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

[BLADE-64] Deploy AA contracts on blade #63

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions command/genesis/polybft_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,10 @@ func (p *genesisParams) deployContracts(rewardTokenByteCode []byte,
artifact: contractsapi.ChildTimelock,
address: contracts.ChildTimelockContractV1,
},
{
artifact: contractsapi.EntryPoint,
address: contracts.EntryPointContractV1,
},
}

if !params.nativeTokenConfig.IsMintable {
Expand Down
4 changes: 4 additions & 0 deletions consensus/polybft/contractsapi/artifacts-gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,10 @@ func main() {
"blade/governance/ChildTimelock.sol",
"ChildTimelock",
},
{
"blade/accountAbstraction/EntryPoint.sol",
"EntryPoint",
},
}

str := `// This is auto-generated file. DO NOT EDIT.
Expand Down
1 change: 1 addition & 0 deletions consensus/polybft/contractsapi/gen_sc_data.go

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions consensus/polybft/contractsapi/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ var (
ChildGovernor *contracts.Artifact
ChildTimelock *contracts.Artifact

// Account Abstraction
EntryPoint *contracts.Artifact

// test smart contracts
//go:embed test-contracts/*
testContracts embed.FS
Expand Down Expand Up @@ -342,6 +345,11 @@ func init() {
log.Fatal(err)
}

EntryPoint, err = contracts.DecodeArtifact([]byte(EntryPointArtifact))
if err != nil {
log.Fatal(err)
}

contractArtifacts = map[string]*contracts.Artifact{
"CheckpointManager": CheckpointManager,
"ExitHelper": ExitHelper,
Expand Down Expand Up @@ -395,6 +403,7 @@ func init() {
"TestRewardToken": TestRewardToken,
"ZexCoinERC20": ZexCoinERC20,
"ZexNFT": ZexNFT,
"EntryPoint": EntryPoint,
}
}

Expand Down
9 changes: 8 additions & 1 deletion contracts/system_addresses.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ var (
NetworkParamsContractV1 = types.StringToAddress("0x100e1")
// ForkParamsContract is an address of ForkParams contract which holds data of enabled forks
ForkParamsContract = types.StringToAddress("0x100f")
// ForkParamsContract is the proxy address of ForkParams contract which holds data of enabled forks
// ForkParamsContract is an address of ForkParams contract which holds data of enabled forks
ForkParamsContractV1 = types.StringToAddress("0x100f1")

// SystemCaller is address of account, used for system calls to smart contracts
Expand All @@ -111,6 +111,12 @@ var (
AllowListBridgeAddr = types.StringToAddress("0x0200000000000000000000000000000000000004")
// BlockListBridgeAddr is the address of the bridge block list
BlockListBridgeAddr = types.StringToAddress("0x0300000000000000000000000000000000000004")

// EntryPointContract is the proxy address of EntryPoint contract which is a center point of account abstraction
// EntryPoint must be deployed on this address, as it is the same on all networks
EntryPointContract = types.StringToAddress("0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789")
// EntryPointContract is an address of EntryPoint contract which is a center point of account abstraction
EntryPointContractV1 = types.StringToAddress("0x20011")
)

// GetProxyImplementationMapping retrieves the addresses of proxy contracts that should be deployed unconditionally
Expand All @@ -133,5 +139,6 @@ func GetProxyImplementationMapping() map[types.Address]types.Address {
ForkParamsContract: ForkParamsContractV1,
ChildTimelockContract: ChildTimelockContractV1,
ChildGovernorContract: ChildGovernorContractV1,
EntryPointContract: EntryPointContractV1,
}
}
Loading