aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-03-21 00:25:11 +0800
committerobscuren <geffobscura@gmail.com>2014-03-21 00:25:11 +0800
commit82d0f65dab253e215349ea685382bca9672378d8 (patch)
tree797fcf1e9608c1d35a78cbe04b058276ae7cc039 /ethchain
parentc135b389fe358006bd3586097e1b17232b0c86e6 (diff)
downloaddexon-82d0f65dab253e215349ea685382bca9672378d8.tar
dexon-82d0f65dab253e215349ea685382bca9672378d8.tar.gz
dexon-82d0f65dab253e215349ea685382bca9672378d8.tar.bz2
dexon-82d0f65dab253e215349ea685382bca9672378d8.tar.lz
dexon-82d0f65dab253e215349ea685382bca9672378d8.tar.xz
dexon-82d0f65dab253e215349ea685382bca9672378d8.tar.zst
dexon-82d0f65dab253e215349ea685382bca9672378d8.zip
Comply to Callee structure
Diffstat (limited to 'ethchain')
-rw-r--r--ethchain/contract.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/ethchain/contract.go b/ethchain/contract.go
index 21ac828fe..10c5e2df6 100644
--- a/ethchain/contract.go
+++ b/ethchain/contract.go
@@ -43,12 +43,17 @@ func (c *Contract) State() *State {
return c.state
}
-func (c *Contract) GetMem(num int) *ethutil.Value {
- nb := ethutil.BigToBytes(big.NewInt(int64(num)), 256)
+func (c *Contract) GetMem(num int64) *ethutil.Value {
+ nb := ethutil.BigToBytes(big.NewInt(num), 256)
return c.Addr(nb)
}
+// Return the gas back to the origin. Used by the Virtual machine or Closures
+func (c *Contract) ReturnGas(val *big.Int, state *State) {
+ c.Amount.Add(c.Amount, val)
+}
+
func MakeContract(tx *Transaction, state *State) *Contract {
// Create contract if there's no recipient
if tx.IsContract() {