PolymathNetwork / polymath-core-deprecated

Core Ethereum Smart Contracts for Polymath - The Securities Token Platform
MIT License
66 stars 19 forks source link

Are STO contracts really reusable across multiple ST's #113

Closed adamdossa closed 6 years ago

adamdossa commented 6 years ago

In Compliance.sol there is:
mapping(address => Offering) offerings; which is a mapping from STO contracts to Offering structs.

The Offering struct implies that the same STO contract can be used by multiple ST's (i.e. address[] usedBy).

In practice, that doesn't seem like a good idea - for example what would happen if the same STO was used for two offerings at the same time. The securityTokenOffering function in STO20.sol kind of allows you to reconfigure the STO for a new ST, but it would be dangerous for this to happen in the middle of an existing STO (we don't guard against this - we could add something where it can only be reconfigured if now > _endTime but this isn't perfect depending on what other state the STO maintains).

Perhaps a better approach is to track the reputation of an auditor rather than a specific STO contract? We could then require a 1 - 1 relationship between STs and STOs.

@pabloruiz55 @satyamakgec @Everhusk thoughts?

pabloruiz55 commented 6 years ago

This is a great point you bring up. Actually, an STO should never be reusable across multiple STs, just as you can't really reuse a Crowdsale contract across multiple Tokens. It should always be a 1 to 1 relationship.

Now, what I do believe should be possible is to reuse the "structure" of an STO, that would be the intention of templates. I think the confusion comes from the offering struct having this usedBy field which does not belong in here. an STO should only be usable by one ST.

everhusk commented 6 years ago

Believe this is also fixed with STO factories