@@ -48,19 +48,21 @@ contract Compliance is ICompliance {
4848
4949 Customers public PolyCustomers; // Instance of the Compliance contract
5050 uint256 public constant MINIMUM_VESTING_PERIOD = 60 * 60 * 24 * 100 ; // 100 Day minimum vesting period for POLY earned
51-
51+
5252 // Notifications
5353 event LogTemplateCreated (address indexed _creator , address _template , string _offeringType );
54- event LogNewTemplateProposal (address indexed _securityToken , address _template , address _delegate );
55- event LogNewContractProposal (address indexed _securityToken , address _offeringContract , address _delegate );
54+ event LogNewTemplateProposal (address indexed _securityToken , address _template , address _delegate , uint _templateProposalIndex );
55+ event LogCancelTemplateProposal (address indexed _securityToken , address _template , uint _templateProposalIndex );
56+ event LogNewContractProposal (address indexed _securityToken , address _offeringContract , address _delegate , uint _offeringProposalIndex );
57+ event LogCancelContractProposal (address indexed _securityToken , address _offeringContract , uint _offeringProposalIndex );
5658
5759 /* @param _polyCustomersAddress The address of the Polymath Customers contract */
5860 function Compliance (address _polyCustomersAddress ) public {
5961 PolyCustomers = Customers (_polyCustomersAddress);
6062 }
6163
6264 /**
63- * @dev `setRegsitrarAddress` This function set the SecurityTokenRegistrar contract address.
65+ * @dev `setRegsitrarAddress` This function set the SecurityTokenRegistrar contract address.
6466 * @param _STRegistrar It is the `this` reference of STR contract
6567 * @return bool
6668 */
@@ -69,7 +71,7 @@ contract Compliance is ICompliance {
6971 require (STRegistrar == address (0 ));
7072 STRegistrar = SecurityTokenRegistrar (_STRegistrar);
7173 return true ;
72- }
74+ }
7375
7476 /**
7577 * @dev `createTemplate` is a simple function to create a new compliance template
@@ -132,7 +134,7 @@ contract Compliance is ICompliance {
132134 {
133135 // Verifying that provided _securityToken is generated by securityTokenRegistrar only
134136 var (totalSupply, owner,,) = STRegistrar.getSecurityTokenData (_securityToken);
135- require (totalSupply > 0 && owner != address (0 ));
137+ require (totalSupply > 0 && owner != address (0 ));
136138 // Require that template has not expired, that the caller is the
137139 // owner of the template and that the template has been finalized
138140 require (templates[_template].expires > now );
@@ -144,7 +146,7 @@ contract Compliance is ICompliance {
144146
145147 //Get a reference of the template contract and add it to the templateProposals array
146148 templateProposals[_securityToken].push (_template);
147- LogNewTemplateProposal (_securityToken, _template, msg .sender );
149+ LogNewTemplateProposal (_securityToken, _template, msg .sender ,templateProposals[_securityToken]. length - 1 );
148150 return true ;
149151 }
150152
@@ -164,6 +166,8 @@ contract Compliance is ICompliance {
164166 var (chosenTemplate,,,,) = ISecurityToken (_securityToken).getTokenDetails ();
165167 require (chosenTemplate != proposedTemplate);
166168 templateProposals[_securityToken][_templateProposalIndex] = address (0 );
169+ LogCancelTemplateProposal (_securityToken, proposedTemplate, _templateProposalIndex);
170+
167171 return true ;
168172 }
169173
@@ -206,15 +210,15 @@ contract Compliance is ICompliance {
206210 {
207211 // Verifying that provided _securityToken is generated by securityTokenRegistrar only
208212 var (totalSupply, owner,,) = STRegistrar.getSecurityTokenData (_securityToken);
209- require (totalSupply > 0 && owner != address (0 ));
213+ require (totalSupply > 0 && owner != address (0 ));
210214
211215 var (,,,,KYC) = ISecurityToken (_securityToken).getTokenDetails ();
212216 var (,,, verified, expires) = PolyCustomers.getCustomer (KYC, offerings[_stoContract].auditor);
213217 require (offerings[_stoContract].auditor == msg .sender );
214218 require (verified);
215219 require (expires > now );
216220 offeringProposals[_securityToken].push (_stoContract);
217- LogNewContractProposal (_securityToken, _stoContract, msg .sender );
221+ LogNewContractProposal (_securityToken, _stoContract, msg .sender ,offeringProposals[_securityToken]. length - 1 );
218222 return true ;
219223 }
220224
@@ -234,6 +238,8 @@ contract Compliance is ICompliance {
234238 var (,,,,chosenOffering) = ISecurityToken (_securityToken).getTokenDetails ();
235239 require (chosenOffering != proposedOffering);
236240 offeringProposals[_securityToken][_offeringProposalIndex] = address (0 );
241+ LogCancelContractProposal (_securityToken, proposedOffering, _offeringProposalIndex);
242+
237243 return true ;
238244 }
239245
@@ -273,6 +279,15 @@ contract Compliance is ICompliance {
273279 return templateProposals[_securityTokenAddress][_templateIndex];
274280 }
275281
282+ /**
283+ * @dev Get an array containing the address of all template proposals for a given ST
284+ * @param _securityTokenAddress The security token ethereum address
285+ * @return Template proposals array
286+ */
287+ function getAllTemplateProposals (address _securityTokenAddress ) view public returns (address []){
288+ return templateProposals[_securityTokenAddress];
289+ }
290+
276291 /**
277292 * @dev Get security token offering smart contract details by the proposal index
278293 * @param _securityTokenAddress The security token ethereum address
@@ -296,4 +311,13 @@ contract Compliance is ICompliance {
296311 );
297312 }
298313
314+ /**
315+ * @dev Get an array containing the address of all offering proposals for a given ST
316+ * @param _securityTokenAddress The security token ethereum address
317+ * @return Offering proposals array
318+ */
319+ function getAllOfferingProposals (address _securityTokenAddress ) view public returns (address []){
320+ return offeringProposals[_securityTokenAddress];
321+ }
322+
299323}
0 commit comments