diff options
author | Gustav Simonsson <gustav.simonsson@gmail.com> | 2015-11-27 22:40:29 +0800 |
---|---|---|
committer | Jeffrey Wilcke <geffobscura@gmail.com> | 2016-02-18 17:08:11 +0800 |
commit | 371871d685d54b916aef28de689d6f0af7822083 (patch) | |
tree | e704b02ba2ffd2d1164001885fba15106b0f7d94 /core/vm/contract.go | |
parent | aa36a6ae4f24f07e2c470a21c93ff37ad5861982 (diff) | |
download | dexon-371871d685d54b916aef28de689d6f0af7822083.tar dexon-371871d685d54b916aef28de689d6f0af7822083.tar.gz dexon-371871d685d54b916aef28de689d6f0af7822083.tar.bz2 dexon-371871d685d54b916aef28de689d6f0af7822083.tar.lz dexon-371871d685d54b916aef28de689d6f0af7822083.tar.xz dexon-371871d685d54b916aef28de689d6f0af7822083.tar.zst dexon-371871d685d54b916aef28de689d6f0af7822083.zip |
parmas, crypto, core, core/vm: homestead consensus protocol changes
* change gas cost for contract creating txs
* invalidate signature with s value greater than secp256k1 N / 2
* OOG contract creation if not enough gas to store code
* new difficulty adjustment algorithm
* new DELEGATECALL op code
Diffstat (limited to 'core/vm/contract.go')
-rw-r--r-- | core/vm/contract.go | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/core/vm/contract.go b/core/vm/contract.go index 5981dcca0..dac81a529 100644 --- a/core/vm/contract.go +++ b/core/vm/contract.go @@ -26,12 +26,14 @@ import ( type ContractRef interface { ReturnGas(*big.Int, *big.Int) Address() common.Address + SetAddress(common.Address) + Value() *big.Int SetCode([]byte) EachStorage(cb func(key, value []byte)) } // Contract represents an ethereum contract in the state database. It contains -// the the contract code, calling arguments. Contract implements ContractReg +// the the contract code, calling arguments. Contract implements ContractRef type Contract struct { caller ContractRef self ContractRef @@ -45,6 +47,8 @@ type Contract struct { value, Gas, UsedGas, Price *big.Int Args []byte + + DelegateCall bool } // Create a new context for the given data items. @@ -114,6 +118,16 @@ func (c *Contract) Address() common.Address { return c.self.Address() } +// SetAddress sets the contracts address +func (c *Contract) SetAddress(addr common.Address) { + c.self.SetAddress(addr) +} + +// Value returns the contracts value (sent to it from it's caller) +func (c *Contract) Value() *big.Int { + return c.value +} + // SetCode sets the code to the contract func (self *Contract) SetCode(code []byte) { self.Code = code |