-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement base hedera account service system contract classes (#…
…13167) Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>
- Loading branch information
1 parent
781dd27
commit 0e8eca1
Showing
21 changed files
with
834 additions
and
356 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
...ava/com/hedera/node/app/service/contract/impl/exec/systemcontracts/HasSystemContract.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright (C) 2023-2024 Hedera Hashgraph, LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.hedera.node.app.service.contract.impl.exec.systemcontracts; | ||
|
||
import static com.hedera.node.app.service.contract.impl.utils.ConversionUtils.asNumberedContractId; | ||
|
||
import com.hedera.hapi.node.base.ContractID; | ||
import com.hedera.node.app.service.contract.impl.exec.systemcontracts.common.AbstractNativeSystemContract; | ||
import com.hedera.node.app.service.contract.impl.exec.systemcontracts.has.HasCallFactory; | ||
import com.hedera.node.app.service.contract.impl.exec.utils.FrameUtils; | ||
import edu.umd.cs.findbugs.annotations.NonNull; | ||
import javax.inject.Inject; | ||
import javax.inject.Singleton; | ||
import org.hyperledger.besu.datatypes.Address; | ||
import org.hyperledger.besu.evm.frame.MessageFrame; | ||
import org.hyperledger.besu.evm.gascalculator.GasCalculator; | ||
|
||
@Singleton | ||
public class HasSystemContract extends AbstractNativeSystemContract implements HederaSystemContract { | ||
public static final String HAS_SYSTEM_CONTRACT_NAME = "HAS"; | ||
public static final String HAS_EVM_ADDRESS = "0x16a"; | ||
public static final ContractID HAS_CONTRACT_ID = asNumberedContractId(Address.fromHexString(HAS_EVM_ADDRESS)); | ||
|
||
@Inject | ||
public HasSystemContract(@NonNull final GasCalculator gasCalculator, @NonNull final HasCallFactory callFactory) { | ||
super(HAS_SYSTEM_CONTRACT_NAME, callFactory, HAS_CONTRACT_ID, gasCalculator); | ||
} | ||
|
||
// Call type is not relevant for the HAS system contracts | ||
@Override | ||
protected FrameUtils.CallType callTypeOf(MessageFrame frame) { | ||
return FrameUtils.callTypeForAccountOf(frame); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.