# Sharing Your Code On Agnostico

## Steps To Share Your Code

### Prerequisites

* A Github Account (Create one if you don't already have one, you can click [here](https://github.com/signup).)
* Basic to Advanced knowledge of solidity (agnostico currently supports only [solidity](https://docs.soliditylang.org/).)
* Basic knowledge of [IPFS](https://ipfs.io/)
* A non-custodial wallet browser extension. [Metamask](https://metamask.io/) recommended.

### 1. Authentication

a. Click on the Share navigation button on the top of the page as shown below

![](https://2280469857-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfVs9UxujtT3mMWVlAbB3%2Fuploads%2FggkSmNj13kgfX8i407Dj%2Fimage.png?alt=media\&token=d51f019f-b28a-41e8-8f1b-4484d3d03e1e)

b. Click on the github signin button. You will be redirected to github to sign in

![](https://2280469857-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfVs9UxujtT3mMWVlAbB3%2Fuploads%2FHSuUJQek2mFLrCyGNOo3%2Fimage.png?alt=media\&token=e8d144cb-6a0f-455d-a60d-391be1eaf22e)

### 2. Add Code To Share

Agnostico uses [(IPFS)](https://ipfs.io/). This is to provide transparency and consistent availability. The content of the file is used to mint NFT to the creatorAddress address in the field specified

![](https://2280469857-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfVs9UxujtT3mMWVlAbB3%2Fuploads%2FCG4VTokkiFisl4awrnDi%2Fimage.png?alt=media\&token=bb54a383-cc7b-45b4-adc7-a89a54f320d5)

Two documents are required to share your code: The first is the contract code file itself; the other one is Agnostico Document Standard or “AgnoDoc”! However, both documents have strict rules for them to work on the platform after you share them. Let's explore both documents below:

*   Contract

    Uploading your contract file from the platform is optional, the essence is to get the Content IDentifier (CID) of the file uploaded.

    * Must be a .sol file
    * Must be able to compile in solidity ^0.8.0.
    * Must not accept dynamic values from the constructor (Agnostico doesn't currently support upgradable contracts)
*   AgnoDoc

    This Document must be uploaded on the platform, its CID will be used in the Agnostico's contract.

    * Must be a .json file
    * Must have the following fields:
      * name: The name you want to give the code you are sharing, make it descriptive and short
      * contractName: This is the name of the contract to be deployed when requested. If your contract looks like `contract MyAwesomeContract is Context, Ownable {...}` , Your targetContract is MyAwesomeContract.
      * creatorAdddres: This is the address of the contract creator. It is also where payment will be sent for each deployment of submitted contract
      * categories: A list of key words that relates to the contract being shared.
      * external\_url: Repo where other users can find the soidity file.
      * description: A short, description of the code being shared. What it does, etc.
      * image: The CID of the solidity contract file. It should look like this “QmXEdvbMdpMP3Pun...”.
      * deploymentVariables: If your contract uses varaibles in its constructor, provide them here as an array of objects with the following properties:
        * name: The name of the argument e.g tokenName, duration
        * dataType: The type of the argument e.g string, uint256
      * category: An array of strings describing the catgories of code, e.g token, erc20, timelock

![](https://2280469857-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfVs9UxujtT3mMWVlAbB3%2Fuploads%2FayDvUxXs0ILd0yzrCHqu%2Fimage.png?alt=media\&token=f33f5ba9-178b-4589-93ca-d38a0c497cde)

Option 2: Fill in the form

Toggle the switch button and enter all the required information and click on the “

![](https://2280469857-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfVs9UxujtT3mMWVlAbB3%2Fuploads%2FETShmrY9gS4ZqJ0tMydE%2Fimage.png?alt=media\&token=fae496af-0b5e-47a4-862f-b37d37953342)

![](https://2280469857-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfVs9UxujtT3mMWVlAbB3%2Fuploads%2FbVRkvX96826K4cJ1vqxR%2Fimage.png?alt=media\&token=bb7a81ad-4491-403b-8a3d-02885f59af8c)

### 3. Add AgnoDoc To Agnostico Factory Contract

Once you click on continue, if you haven't connected your metamask wallet from before now, you will be prompted to do so. The IPFS CID for your AgnoDoc is hashed to bytes32 and stored in the smart contract for future reference.

![](https://2280469857-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfVs9UxujtT3mMWVlAbB3%2Fuploads%2FeSawvGqqef4dPJLUqDRt%2Fimage.png?alt=media\&token=d3b9b29a-63df-471e-947c-2837c8aa5757)

![](https://2280469857-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfVs9UxujtT3mMWVlAbB3%2Fuploads%2FzZDBaBMEIisblqbx2mwd%2Fimage.png?alt=media\&token=bda6ff09-a7bd-4922-9df9-f7657cff1146)

![](https://2280469857-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfVs9UxujtT3mMWVlAbB3%2Fuploads%2FUUou2x5YYOJs1TKO2X2h%2Fimage.png?alt=media\&token=fb26de64-4330-4968-afc9-f97df84e55eb)

Congratulations if you have successfully followed up till this stage, you are officially a code provider on Agnostico. Others can now deploy your code.

Should you decide to withdraw your code from our smart contract, you can interact with the factory at the following addresses:
