diff options
Diffstat (limited to 'test/compilationTests/MultiSigWallet/Factory.sol')
-rw-r--r-- | test/compilationTests/MultiSigWallet/Factory.sol | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/compilationTests/MultiSigWallet/Factory.sol b/test/compilationTests/MultiSigWallet/Factory.sol new file mode 100644 index 00000000..f1be6884 --- /dev/null +++ b/test/compilationTests/MultiSigWallet/Factory.sol @@ -0,0 +1,28 @@ +contract Factory { + + event ContractInstantiation(address sender, address instantiation); + + mapping(address => bool) public isInstantiation; + mapping(address => address[]) public instantiations; + + /// @dev Returns number of instantiations by creator. + /// @param creator Contract creator. + /// @return Returns number of instantiations by creator. + function getInstantiationCount(address creator) + public + constant + returns (uint) + { + return instantiations[creator].length; + } + + /// @dev Registers contract in factory registry. + /// @param instantiation Address of contract instantiation. + function register(address instantiation) + internal + { + isInstantiation[instantiation] = true; + instantiations[msg.sender].push(instantiation); + ContractInstantiation(msg.sender, instantiation); + } +} |