credmark.cmf.types.contract.Contracts

DTO class Contracts(*, contracts=[])[source]

Bases: IterableListGenericDTO[Contract]

Show JSON schema
{
   "title": "Contracts",
   "type": "object",
   "properties": {
      "contracts": {
         "title": "Contracts",
         "description": "A List of Contracts",
         "default": [],
         "type": "array",
         "items": {
            "$ref": "#/definitions/Contract"
         }
      }
   },
   "definitions": {
      "Contract": {
         "title": "Contract",
         "description": "Contract object to make web3 call smart contract functions.\nYou could create a contract with the following\n\n    c = Contract(address='0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2')\n\n    c = Contract('0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2')",
         "type": "object",
         "properties": {
            "address": {
               "title": "Address",
               "type": "string",
               "pattern": "^0x[a-fA-F0-9]{40}$",
               "format": "evm-address"
            }
         },
         "required": [
            "address"
         ],
         "examples": [
            {
               "address": "0x1F98431c8aD98523631AE4a59f267346ea31F984"
            },
            {
               "address": "0x1F98431c8aD98523631AE4a59f267346ea31F984",
               "abi": "(Optional) contract abi JSON string or list"
            }
         ]
      }
   }
}

Fields
Parameters

contracts (List[Contract]) –

Return type

None

field contracts: List[Contract] = []

A List of Contracts

append(obj)
classmethod empty()[source]

Create a Contracts instance with no contracts.

Return type

Contracts

extend(obj)
classmethod from_addresses(addresses)[source]

Create a Contracts instance from a list of addresses.

Parameters

addresses (List[Address]) –

Return type

Contracts