github.com/annchain/OG@v0.0.9/vm/types/interface.go (about)

     1  // Copyright 2016 The go-ethereum Authors
     2  // This file is part of the go-ethereum library.
     3  //
     4  // The go-ethereum library is free software: you can redistribute it and/or modify
     5  // it under the terms of the GNU Lesser General Public License as published by
     6  // the Free Software Foundation, either version 3 of the License, or
     7  // (at your option) any later version.
     8  //
     9  // The go-ethereum library is distributed in the hope that it will be useful,
    10  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    11  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    12  // GNU Lesser General Public License for more details.
    13  //
    14  // You should have received a copy of the GNU Lesser General Public License
    15  // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
    16  
    17  package types
    18  
    19  import (
    20  	ogTypes "github.com/annchain/OG/arefactor/og_interface"
    21  	"math/big"
    22  )
    23  
    24  // Caller provides a basic interface for the OVM calling conventions. The OVM
    25  // depends on this context being implemented for doing subcalls and initialising new OVM contracts.
    26  type Caller interface {
    27  	// Call another contract
    28  	Call(me ContractRef, addr ogTypes.Address20, data []byte, gas uint64, value *big.Int, txCall bool) (resp []byte, leftOverGas uint64, err error)
    29  	// Take another's contract code and execute within our own context
    30  	CallCode(me ContractRef, addr ogTypes.Address20, data []byte, gas uint64, value *big.Int) (resp []byte, leftOverGas uint64, err error)
    31  	// Same as CallCode except sender and value is propagated from parent to child scope
    32  	DelegateCall(me ContractRef, addr ogTypes.Address20, data []byte, gas uint64) (resp []byte, leftOverGas uint64, err error)
    33  	// Create a new contract
    34  	Create(me ContractRef, data []byte, gas uint64, value *big.Int, txCall bool) (resp []byte, contractAddr ogTypes.Address20, leftOverGas uint64, err error)
    35  	// Create a new contract use sha3
    36  	Create2(caller ContractRef, code []byte, gas uint64, endowment *big.Int, salt *big.Int, txCall bool) (ret []byte, contractAddr ogTypes.Address20, leftOverGas uint64, err error)
    37  
    38  	StaticCall(caller ContractRef, addr ogTypes.Address20, input []byte, gas uint64) (ret []byte, leftOverGas uint64, err error)
    39  }