Skip to main content

Smart Contract - The Company Ordinance

Overview#

The Company Ordinance Protocol is an opensource project that welcome any public auditing and development (https://github.com/kiostudio/company-ordinance). The idea of this smart contract is to convert the business law practice in common law jurisdiction (e.g Hong Kong) into code and become a global paradigm on the blockchain.

This smart contract protocol is written in solidity and include the follwing components :

Contract NameDescriptionStatus
companyRegistration.solIssue ERC721 Token as the business certificateProduction
companyBoardFactoryCloneV1.solContract factory to create a new company boardDevelopment
companyBoardV1.solCompany baord for GovernanceDevelopment
sharesIssuerFactoryCloneV1.solContract factory to create a new shares issuer of a companyDevelopment
sharesIssuerV1.solIssue crypto shares of the company as a ERC20 TokenDevelopment
companySecretary721FactoryCloneV1.solontract factory to create a new ERC721 Token issuer of a companyDevelopment
companySecretary721V1.solIssue ERC721 Token on behalf of the comapnyDevelopment
companySecretary1155V1.solIssue ERC1155 Token on behalf of the comapnyDevelopment

Right now most of the features of the smart contract are still undesr development, the only production ready feature will be the business certificate issuer.

Business Certificate Registration#

Source Code : companyRegistration.sol

The business certificate issuer has been deployed to the following blockchain network :

BlockchainNetworkStatusAddress
EthereumHomestead (Main)WIP
EthereumRopsten (Test)Deployed0x8E1558B6B8a3ef346d187EABbe9B08C4DdFf336B

The contract is build on top of the ERC721 industry standard of openzeppelin as follow :

ERC721PresetMinterPauserAutoId#

Function 1 : Mint a Business Certificate#

mint(address to)
ParametersDescription
address toA wallet address (cannot be the zero address)
  • Please make sure we grant you the mint role if you are using our deployed contract.
  • To get the grant of the mint role, please register as an on chain company via the GUI OR contract us by benho@onchain.company.

Function 2 : Check Balance of the Certificate Owner#

balanceOf(address owner)
ParametersDescription
address ownerA wallet address (cannot be the zero address)
  • Returns the number of tokens in owner's account. → uint256 balance

Function 3 : List the Business Certificate of a Owner#

tokenOfOwnerByIndex(owner, index)
ParametersDescription
ownerA wallet address (cannot be the zero address)
indexResult from function 2
  • Returns a token ID owned by owner at a given index of its token list. Use along with balanceOf to enumerate all of owner's tokens. → uint256 tokenId

Function 4 : Get Business Certificate tokenId#

balanceOf(address owner)
  • Returns the number of tokens in owner's account. → uint256 balance

Read the metadata of a Business Certificate#

You can read the metadata of a business certificate with the following url :

https://app.onchain.company/br/certificate/TOKEN_ID
  • As mentioned before, tokenID can be retrived by interacting with the smart contract with function 1-4 above OR with our web app.