aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen/ContractCompiler.h
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-01-25 23:45:54 +0800
committerGitHub <noreply@github.com>2018-01-25 23:45:54 +0800
commite7afde9587ff3b8d823292e64e119bd27ff83743 (patch)
treed47c5993e043db69cc4cbfe23b4965c83a4fb5d8 /libsolidity/codegen/ContractCompiler.h
parent513c771e2cbe9037db6f19f2a106e6c309c0d48a (diff)
parentf7315d19bdd5c83173d7eb42dcf907a4af0c0c94 (diff)
downloaddexon-solidity-e7afde9587ff3b8d823292e64e119bd27ff83743.tar
dexon-solidity-e7afde9587ff3b8d823292e64e119bd27ff83743.tar.gz
dexon-solidity-e7afde9587ff3b8d823292e64e119bd27ff83743.tar.bz2
dexon-solidity-e7afde9587ff3b8d823292e64e119bd27ff83743.tar.lz
dexon-solidity-e7afde9587ff3b8d823292e64e119bd27ff83743.tar.xz
dexon-solidity-e7afde9587ff3b8d823292e64e119bd27ff83743.tar.zst
dexon-solidity-e7afde9587ff3b8d823292e64e119bd27ff83743.zip
Merge pull request #3203 from ethereum/nocall
Prevent libraries from being called.
Diffstat (limited to 'libsolidity/codegen/ContractCompiler.h')
-rw-r--r--libsolidity/codegen/ContractCompiler.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/libsolidity/codegen/ContractCompiler.h b/libsolidity/codegen/ContractCompiler.h
index 7c5ee59f..1fd80d05 100644
--- a/libsolidity/codegen/ContractCompiler.h
+++ b/libsolidity/codegen/ContractCompiler.h
@@ -75,10 +75,19 @@ private:
/// with a new and initialized context. Adds the constructor code.
/// @returns the identifier of the runtime sub assembly
size_t packIntoContractCreator(ContractDefinition const& _contract);
+ /// Appends code that deploys the given contract as a library.
+ /// Will also add code that modifies the contract in memory by injecting the current address
+ /// for the call protector.
+ size_t deployLibrary(ContractDefinition const& _contract);
/// Appends state variable initialisation and constructor code.
void appendInitAndConstructorCode(ContractDefinition const& _contract);
void appendBaseConstructor(FunctionDefinition const& _constructor);
void appendConstructor(FunctionDefinition const& _constructor);
+ /// Appends code that returns a boolean flag on the stack that tells whether
+ /// the contract has been called via delegatecall (false) or regular call (true).
+ /// This is done by inserting a specific push constant as the first instruction
+ /// whose data will be modified in memory at deploy time.
+ void appendDelegatecallCheck();
void appendFunctionSelector(ContractDefinition const& _contract);
void appendCallValueCheck();
/// Creates code that unpacks the arguments for the given function represented by a vector of TypePointers.