The public repository for all smart contracts used by Aktionariat.
There are five notable smart contracts in this repository:
- Our custom Multisignature Contract, providing the basis for corporate accounts with multiple signers.
- The ERC20Recoverable Contract, implementing our decentralized claim mechanism for lost tokens.
- The ERC20Draggable Contract, implementing the drag-along clause found in many shareholder agreements.
- The ERC20Allowlistable Contract, providing a highly efficient and elaborate way to enforce transfer restrictions.
- The Brokerbot Contract, providing mechanisms for the selling and repurchasing of shares with automated price adjustments.
Futhermore, there is a Shares Contract that can contain all the functions to deploy a token that can represent shares under Swiss law. Also, we'd like to point to our elegant implementation of infinite allowances.
Generally, there are two approaches to add functionality to basic ERC20 tokens. A commonly used bad one and the better one we are trying to follow.
The first approach is what we call the "cat-in-the-bag" approach. This is followed by most issuers of non-trivial ERC20 tokens and allows them to arbitrarily change the functionality of the token at a later point in time. Under this approach, the users are only interacting with a proxy that in the background redirects all requests to other smart contracts configurable by the issuer. That way, the issuer can arbitrarily update the contract, freeze tokens or even take them into their possession. This not only goes against the spirit of decentralized finance, but also against the recommendations of the Swiss Blockchain Federation and potentially also against the legal requirements for security tokens, which require the owners, but not the issuer, to have control over their tokens.
We believe in a modular approach in which functionality is added by composition, thereby providing much stronger property rights to the token holders. Under the modular approach, a basic ERC20 token with minimal functionality is issued first. In our case, this base token is reflected by the smart contract simply named Shares. It is designed to (hopefully) last for as long as the Ethereum network exists. New features are added not by changing the base token, but by wrapping them into tokens with additional functionality. For example, all Aktionariat AG Shares (AKS) in circulation have been wrapped by Draggable Aktionariat AG Shares (DAKS) token before selling them. Once the drag-along clause get triggered in an acquisition of if the majority of token holders vote to terminate the shareholder agreement, holders of DAKS token can unwrap them to convert them back to AKS tokens, which then could be wrapped into a new contract representing a new shareholder agreement. Under the modular approach, updates of the functionality of a token require the consent of the token holders and these updates are reflected by an explicit change of the contract users interact with.
Companies that choose Aktionariat as tokenization provider get access to a corporate dashboard on which board members can issue multisignature transaction to configure their smart contract. Furthermore, they get access to an electronic shareholder registry that shows which shareholder holds how many shares and that is automatically updated to reflect all blockchain-based token transfers. All personal data is stored in our database and not on the blockchain. In order to become a registered shareholder, token holders must provide their name and address and prove ownership of their tokens, which can be done through a widget on the issuer's website or our app.
This approach reflects how paper certificates are handled, with the paper corresponding to the tokens. Owners of certificated shares are free to hand them over to anyone at any time, but to actually enjoy any shareholder rights, the new owner must register themselves with the company. This enables short-term trading of the token without registration, while at the same time providing a strong incentive for long-term shareholders to actually register themselves in the shareholder registry. See also the recommendations of the Swiss Blockchain Federation.
If you find a new security-relevant bug in our contracts and tell us, we will reward you with 1 Ether. For bugs that could lead to a loss of funds, the bounty is tripled. The bounty can only be claimed for bugs that we are not aware of and that have not been exploited yet. They must be filed directly to [email protected] without opening a publicly visible issue.
You'll need the following:
Clone the repository, open it, and install nodejs packages with yarn
:
git clone [email protected]:aktionariat/contracts.git
cd contracts
yarn install
to run a local node use
yarn hardhat node
(it will use on your default network, to use on a different network use --network )
yarn compile
yarn test
yarn hardhat deploy --network ropsten
This will run all deployment scripts in the deploy folder. To specify seperate deployments use tags.
yarn hardhat --network ropsten etherscan-verify
(don't forget to set ETHERSCAN_API_KEY in .env)
task to create a multisig clone from the clonefactory: create-multisig-clone
yarn hardhat create-multisig-clone --factory <multisigCloneFactory_Address> --owner <address> --salt <string_which_gets_formated_in_byte32>
(it will run on your default network, to run on a different network use --network )
(.env configuration is needed as seen in .env.template, at minimum the mnemonic of the network you deploy to and Infura/Alchemy ApiKey) To be guided through the contract deployment use
yarn deploy
this script also includes: (optional) verification of contracts (.env needs ETHERSCAN_API_KEY) (optional) registration in the aktionariat back-end (.env needs AKTIONARIAT_API_KEY and AKTIONARIAT_API_URL)
All our smart contracts are open-source and can be used under a slightly modified MIT License with Automated License Fee Payments. This means that you are free to use our contracts as long as you do not make any changes to circumvent the built-in license fee payments to our address 0x29Fe8914e76da5cE2d90De98a64d0055f199d06D, if there are any. Note that some of the source code you find in this repository stems from other sources with other licenses. These are marked accordingly.