{
  "metadataVersion": "0.1.0",
  "source": {
    "hash": "0x6be8492017fe96b7a92bb39b4ede04b96effb8fcaf9237bfdccef7d9e732c760",
    "language": "ink! 3.0.0-rc4",
    "compiler": "rustc 1.56.0-nightly"
  },
  "contract": {
    "name": "erc20",
    "version": "3.0.0-rc4",
    "authors": [
      "Parity Technologies <admin@parity.io>"
    ]
  },
  "spec": {
    "constructors": [
      {
        "args": [
          {
            "name": "initial_supply",
            "type": {
              "displayName": [
                "Balance"
              ],
              "type": 1
            }
          }
        ],
        "docs": [
          "Creates a new ERC-20 contract with the specified initial supply."
        ],
        "name": [
          "new"
        ],
        "selector": "0x9bae9d5e"
      }
    ],
    "docs": [],
    "events": [
      {
        "args": [
          {
            "docs": [],
            "indexed": true,
            "name": "from",
            "type": {
              "displayName": [
                "Option"
              ],
              "type": 15
            }
          },
          {
            "docs": [],
            "indexed": true,
            "name": "to",
            "type": {
              "displayName": [
                "Option"
              ],
              "type": 15
            }
          },
          {
            "docs": [],
            "indexed": false,
            "name": "value",
            "type": {
              "displayName": [
                "Balance"
              ],
              "type": 1
            }
          }
        ],
        "docs": [
          " Event emitted when a token transfer occurs."
        ],
        "name": "Transfer"
      },
      {
        "args": [
          {
            "docs": [],
            "indexed": true,
            "name": "owner",
            "type": {
              "displayName": [
                "AccountId"
              ],
              "type": 5
            }
          },
          {
            "docs": [],
            "indexed": true,
            "name": "spender",
            "type": {
              "displayName": [
                "AccountId"
              ],
              "type": 5
            }
          },
          {
            "docs": [],
            "indexed": false,
            "name": "value",
            "type": {
              "displayName": [
                "Balance"
              ],
              "type": 1
            }
          }
        ],
        "docs": [
          " Event emitted when an approval occurs that `spender` is allowed to withdraw",
          " up to the amount of `value` tokens from `owner`."
        ],
        "name": "Approval"
      }
    ],
    "messages": [
      {
        "args": [],
        "docs": [
          " Returns the total token supply."
        ],
        "mutates": false,
        "name": [
          "total_supply"
        ],
        "payable": false,
        "returnType": {
          "displayName": [
            "Balance"
          ],
          "type": 1
        },
        "selector": "0xdb6375a8"
      },
      {
        "args": [
          {
            "name": "owner",
            "type": {
              "displayName": [
                "AccountId"
              ],
              "type": 5
            }
          }
        ],
        "docs": [
          " Returns the account balance for the specified `owner`.",
          "",
          " Returns `0` if the account is non-existent."
        ],
        "mutates": false,
        "name": [
          "balance_of"
        ],
        "payable": false,
        "returnType": {
          "displayName": [
            "Balance"
          ],
          "type": 1
        },
        "selector": "0x0f755a56"
      },
      {
        "args": [
          {
            "name": "owner",
            "type": {
              "displayName": [
                "AccountId"
              ],
              "type": 5
            }
          },
          {
            "name": "spender",
            "type": {
              "displayName": [
                "AccountId"
              ],
              "type": 5
            }
          }
        ],
        "docs": [
          " Returns the amount which `spender` is still allowed to withdraw from `owner`.",
          "",
          " Returns `0` if no allowance has been set `0`."
        ],
        "mutates": false,
        "name": [
          "allowance"
        ],
        "payable": false,
        "returnType": {
          "displayName": [
            "Balance"
          ],
          "type": 1
        },
        "selector": "0x6a00165e"
      },
      {
        "args": [
          {
            "name": "to",
            "type": {
              "displayName": [
                "AccountId"
              ],
              "type": 5
            }
          },
          {
            "name": "value",
            "type": {
              "displayName": [
                "Balance"
              ],
              "type": 1
            }
          }
        ],
        "docs": [
          " Transfers `value` amount of tokens from the caller's account to account `to`.",
          "",
          " On success a `Transfer` event is emitted.",
          "",
          " # Errors",
          "",
          " Returns `InsufficientBalance` error if there are not enough tokens on",
          " the caller's account balance."
        ],
        "mutates": true,
        "name": [
          "transfer"
        ],
        "payable": false,
        "returnType": {
          "displayName": [
            "Result"
          ],
          "type": 12
        },
        "selector": "0x84a15da1"
      },
      {
        "args": [
          {
            "name": "spender",
            "type": {
              "displayName": [
                "AccountId"
              ],
              "type": 5
            }
          },
          {
            "name": "value",
            "type": {
              "displayName": [
                "Balance"
              ],
              "type": 1
            }
          }
        ],
        "docs": [
          " Allows `spender` to withdraw from the caller's account multiple times, up to",
          " the `value` amount.",
          "",
          " If this function is called again it overwrites the current allowance with `value`.",
          "",
          " An `Approval` event is emitted."
        ],
        "mutates": true,
        "name": [
          "approve"
        ],
        "payable": false,
        "returnType": {
          "displayName": [
            "Result"
          ],
          "type": 12
        },
        "selector": "0x681266a0"
      },
      {
        "args": [
          {
            "name": "from",
            "type": {
              "displayName": [
                "AccountId"
              ],
              "type": 5
            }
          },
          {
            "name": "to",
            "type": {
              "displayName": [
                "AccountId"
              ],
              "type": 5
            }
          },
          {
            "name": "value",
            "type": {
              "displayName": [
                "Balance"
              ],
              "type": 1
            }
          }
        ],
        "docs": [
          " Transfers `value` tokens on the behalf of `from` to the account `to`.",
          "",
          " This can be used to allow a contract to transfer tokens on ones behalf and/or",
          " to charge fees in sub-currencies, for example.",
          "",
          " On success a `Transfer` event is emitted.",
          "",
          " # Errors",
          "",
          " Returns `InsufficientAllowance` error if there are not enough tokens allowed",
          " for the caller to withdraw from `from`.",
          "",
          " Returns `InsufficientBalance` error if there are not enough tokens on",
          " the account balance of `from`."
        ],
        "mutates": true,
        "name": [
          "transfer_from"
        ],
        "payable": false,
        "returnType": {
          "displayName": [
            "Result"
          ],
          "type": 12
        },
        "selector": "0x0b396f18"
      }
    ]
  },
  "storage": {
    "struct": {
      "fields": [
        {
          "layout": {
            "cell": {
              "key": "0x0000000000000000000000000000000000000000000000000000000000000000",
              "ty": 1
            }
          },
          "name": "total_supply"
        },
        {
          "layout": {
            "struct": {
              "fields": [
                {
                  "layout": {
                    "struct": {
                      "fields": [
                        {
                          "layout": {
                            "cell": {
                              "key": "0x0100000000000000000000000000000000000000000000000000000000000000",
                              "ty": 2
                            }
                          },
                          "name": "header"
                        },
                        {
                          "layout": {
                            "struct": {
                              "fields": [
                                {
                                  "layout": {
                                    "cell": {
                                      "key": "0x0200000000000000000000000000000000000000000000000000000000000000",
                                      "ty": 3
                                    }
                                  },
                                  "name": "len"
                                },
                                {
                                  "layout": {
                                    "array": {
                                      "cellsPerElem": 1,
                                      "layout": {
                                        "cell": {
                                          "key": "0x0200000001000000000000000000000000000000000000000000000000000000",
                                          "ty": 4
                                        }
                                      },
                                      "len": 4294967295,
                                      "offset": "0x0300000000000000000000000000000000000000000000000000000000000000"
                                    }
                                  },
                                  "name": "elems"
                                }
                              ]
                            }
                          },
                          "name": "entries"
                        }
                      ]
                    }
                  },
                  "name": "keys"
                },
                {
                  "layout": {
                    "hash": {
                      "layout": {
                        "cell": {
                          "key": "0x0300000001000000000000000000000000000000000000000000000000000000",
                          "ty": 9
                        }
                      },
                      "offset": "0x0200000001000000000000000000000000000000000000000000000000000000",
                      "strategy": {
                        "hasher": "Blake2x256",
                        "postfix": "",
                        "prefix": "0x696e6b20686173686d6170"
                      }
                    }
                  },
                  "name": "values"
                }
              ]
            }
          },
          "name": "balances"
        },
        {
          "layout": {
            "struct": {
              "fields": [
                {
                  "layout": {
                    "struct": {
                      "fields": [
                        {
                          "layout": {
                            "cell": {
                              "key": "0x0300000001000000000000000000000000000000000000000000000000000000",
                              "ty": 2
                            }
                          },
                          "name": "header"
                        },
                        {
                          "layout": {
                            "struct": {
                              "fields": [
                                {
                                  "layout": {
                                    "cell": {
                                      "key": "0x0400000001000000000000000000000000000000000000000000000000000000",
                                      "ty": 3
                                    }
                                  },
                                  "name": "len"
                                },
                                {
                                  "layout": {
                                    "array": {
                                      "cellsPerElem": 1,
                                      "layout": {
                                        "cell": {
                                          "key": "0x0400000002000000000000000000000000000000000000000000000000000000",
                                          "ty": 10
                                        }
                                      },
                                      "len": 4294967295,
                                      "offset": "0x0500000001000000000000000000000000000000000000000000000000000000"
                                    }
                                  },
                                  "name": "elems"
                                }
                              ]
                            }
                          },
                          "name": "entries"
                        }
                      ]
                    }
                  },
                  "name": "keys"
                },
                {
                  "layout": {
                    "hash": {
                      "layout": {
                        "cell": {
                          "key": "0x0500000002000000000000000000000000000000000000000000000000000000",
                          "ty": 9
                        }
                      },
                      "offset": "0x0400000002000000000000000000000000000000000000000000000000000000",
                      "strategy": {
                        "hasher": "Blake2x256",
                        "postfix": "",
                        "prefix": "0x696e6b20686173686d6170"
                      }
                    }
                  },
                  "name": "values"
                }
              ]
            }
          },
          "name": "allowances"
        }
      ]
    }
  },
  "types": [
    {
      "def": {
        "primitive": "u128"
      }
    },
    {
      "def": {
        "composite": {
          "fields": [
            {
              "name": "last_vacant",
              "type": 3,
              "typeName": "Index"
            },
            {
              "name": "len",
              "type": 3,
              "typeName": "u32"
            },
            {
              "name": "len_entries",
              "type": 3,
              "typeName": "u32"
            }
          ]
        }
      },
      "path": [
        "ink_storage",
        "collections",
        "stash",
        "Header"
      ]
    },
    {
      "def": {
        "primitive": "u32"
      }
    },
    {
      "def": {
        "variant": {
          "variants": [
            {
              "fields": [
                {
                  "type": 8,
                  "typeName": "VacantEntry"
                }
              ],
              "name": "Vacant"
            },
            {
              "fields": [
                {
                  "type": 5,
                  "typeName": "T"
                }
              ],
              "name": "Occupied"
            }
          ]
        }
      },
      "params": [
        5
      ],
      "path": [
        "ink_storage",
        "collections",
        "stash",
        "Entry"
      ]
    },
    {
      "def": {
        "composite": {
          "fields": [
            {
              "type": 6,
              "typeName": "[u8; 32]"
            }
          ]
        }
      },
      "path": [
        "ink_env",
        "types",
        "AccountId"
      ]
    },
    {
      "def": {
        "array": {
          "len": 32,
          "type": 7
        }
      }
    },
    {
      "def": {
        "primitive": "u8"
      }
    },
    {
      "def": {
        "composite": {
          "fields": [
            {
              "name": "next",
              "type": 3,
              "typeName": "Index"
            },
            {
              "name": "prev",
              "type": 3,
              "typeName": "Index"
            }
          ]
        }
      },
      "path": [
        "ink_storage",
        "collections",
        "stash",
        "VacantEntry"
      ]
    },
    {
      "def": {
        "composite": {
          "fields": [
            {
              "name": "value",
              "type": 1,
              "typeName": "V"
            },
            {
              "name": "key_index",
              "type": 3,
              "typeName": "KeyIndex"
            }
          ]
        }
      },
      "params": [
        1
      ],
      "path": [
        "ink_storage",
        "collections",
        "hashmap",
        "ValueEntry"
      ]
    },
    {
      "def": {
        "variant": {
          "variants": [
            {
              "fields": [
                {
                  "type": 8,
                  "typeName": "VacantEntry"
                }
              ],
              "name": "Vacant"
            },
            {
              "fields": [
                {
                  "type": 11,
                  "typeName": "T"
                }
              ],
              "name": "Occupied"
            }
          ]
        }
      },
      "params": [
        11
      ],
      "path": [
        "ink_storage",
        "collections",
        "stash",
        "Entry"
      ]
    },
    {
      "def": {
        "tuple": [
          5,
          5
        ]
      }
    },
    {
      "def": {
        "variant": {
          "variants": [
            {
              "fields": [
                {
                  "type": 13,
                  "typeName": "T"
                }
              ],
              "name": "Ok"
            },
            {
              "fields": [
                {
                  "type": 14,
                  "typeName": "E"
                }
              ],
              "name": "Err"
            }
          ]
        }
      },
      "params": [
        13,
        14
      ],
      "path": [
        "Result"
      ]
    },
    {
      "def": {
        "tuple": []
      }
    },
    {
      "def": {
        "variant": {
          "variants": [
            {
              "discriminant": 0,
              "name": "InsufficientBalance"
            },
            {
              "discriminant": 1,
              "name": "InsufficientAllowance"
            }
          ]
        }
      },
      "path": [
        "erc20",
        "erc20",
        "Error"
      ]
    },
    {
      "def": {
        "variant": {
          "variants": [
            {
              "name": "None"
            },
            {
              "fields": [
                {
                  "type": 5,
                  "typeName": "T"
                }
              ],
              "name": "Some"
            }
          ]
        }
      },
      "params": [
        5
      ],
      "path": [
        "Option"
      ]
    }
  ]
}