address
- Explore
- View source
- Playground
Loading ....
- YAML
- JSON
ethdebug/format/type/elementary/address
$schema: "https://json-schema.org/draft/2020-12/schema"
$id: "schema:ethdebug/format/type/elementary/address"
title: ethdebug/format/type/elementary/address
description: |
Schema describing the representation of an address type. An address
type with a `definition` is a reference to a contract.
Standard interpretation: the bytes of the value are the address. If the
type has a `definition`, the value refers to that contract. This type has
no size. The number of bytes comes from the value's location.
type: object
properties:
label:
$ref: "schema:ethdebug/format/type/base#/$defs/Label"
class:
const: elementary
kind:
const: address
payable:
type: boolean
description: If this field is omitted, this type represents an address whose
payability is not known.
definition:
description: |
If this field is omitted, this type is a plain address. If present,
this type is a reference to a contract. A contract can be a library
or an interface. The `library` and `interface` fields cannot both be
true.
allOf:
- $ref: "schema:ethdebug/format/type/definition"
- type: object
properties:
library:
type: boolean
description: Indicates that this is a type representing a library
interface:
type: boolean
description: Indicates that this is a type representing an interface
oneOf:
- title: Normal contract type
properties:
library:
const: false
interface:
const: false
- title: Contract library type
properties:
library:
const: true
required:
- library
- title: Contract interface type
properties:
interface:
const: true
required:
- interface
required:
- kind
examples:
- # a type for addresses of unknown payability
kind: address
- # a type for payable addresses
kind: address
payable: true
- # a type for a reference to a contract
kind: address
payable: true
definition:
name: Ballot
- # a type for a reference to a library
kind: address
label: MathLib
definition:
name: MathLib
library: true
- # a type for a reference to an interface
kind: address
definition:
name: IERC20
interface: true
ethdebug/format/type/elementary/address
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "schema:ethdebug/format/type/elementary/address",
"title": "ethdebug/format/type/elementary/address",
"description": "Schema describing the representation of an address type. An address\ntype with a `definition` is a reference to a contract.\n\nStandard interpretation: the bytes of the value are the address. If the\ntype has a `definition`, the value refers to that contract. This type has\nno size. The number of bytes comes from the value's location.\n",
"type": "object",
"properties": {
"label": {
"$ref": "schema:ethdebug/format/type/base#/$defs/Label"
},
"class": {
"const": "elementary"
},
"kind": {
"const": "address"
},
"payable": {
"type": "boolean",
"description": "If this field is omitted, this type represents an address whose payability is not known."
},
"definition": {
"description": "If this field is omitted, this type is a plain address. If present,\nthis type is a reference to a contract. A contract can be a library\nor an interface. The `library` and `interface` fields cannot both be\ntrue.\n",
"allOf": [
{
"$ref": "schema:ethdebug/format/type/definition"
},
{
"type": "object",
"properties": {
"library": {
"type": "boolean",
"description": "Indicates that this is a type representing a library"
},
"interface": {
"type": "boolean",
"description": "Indicates that this is a type representing an interface"
}
},
"oneOf": [
{
"title": "Normal contract type",
"properties": {
"library": {
"const": false
},
"interface": {
"const": false
}
}
},
{
"title": "Contract library type",
"properties": {
"library": {
"const": true
}
},
"required": [
"library"
]
},
{
"title": "Contract interface type",
"properties": {
"interface": {
"const": true
}
},
"required": [
"interface"
]
}
]
}
]
}
},
"required": [
"kind"
],
"examples": [
{
"kind": "address"
},
{
"kind": "address",
"payable": true
},
{
"kind": "address",
"payable": true,
"definition": {
"name": "Ballot"
}
},
{
"kind": "address",
"label": "MathLib",
"definition": {
"name": "MathLib",
"library": true
}
},
{
"kind": "address",
"definition": {
"name": "IERC20",
"interface": true
}
}
]
}
Loading playground...