Smart Contracts

Module: election
back to overview
election
Methods: 13
Instances: 2
Initialization

Parameters
{
  "admin_account": "<AccountAddress>",
  "candidates": [
    {
      "hash": "<String of size 64 containing lowercase hex characters.>",
      "url": "<String>"
    }
  ],
  "decryption_deadline": "<Timestamp (e.g. `2000-01-01T12:00:00Z`)>",
  "delegation_string": "<String>",
  "election_description": "<String>",
  "election_end": "<Timestamp (e.g. `2000-01-01T12:00:00Z`)>",
  "election_manifest": {
    "hash": "<String of size 64 containing lowercase hex characters.>",
    "url": "<String>"
  },
  "election_parameters": {
    "hash": "<String of size 64 containing lowercase hex characters.>",
    "url": "<String>"
  },
  "election_start": "<Timestamp (e.g. `2000-01-01T12:00:00Z`)>",
  "eligible_voters": {
    "data": {
      "hash": "<String of size 64 containing lowercase hex characters.>",
      "url": "<String>"
    },
    "parameters": {
      "end_time": "<Timestamp (e.g. `2000-01-01T12:00:00Z`)>",
      "start_time": "<Timestamp (e.g. `2000-01-01T12:00:00Z`)>"
    }
  },
  "guardians": [
    "<AccountAddress>"
  ]
}
Errors
{
  "Enum": [
    {
      "ParseParams": []
    },
    {
      "Unauthorized": []
    },
    {
      "Malformed": []
    },
    {
      "IncorrectElectionPhase": []
    },
    {
      "DuplicateEntry": []
    },
    {
      "GuardianExcluded": []
    }
  ]
}
Event
None
Methods

Parameters
[
  "<UInt8>"
]
Errors
{
  "Enum": [
    {
      "ParseParams": []
    },
    {
      "Unauthorized": []
    },
    {
      "Malformed": []
    },
    {
      "IncorrectElectionPhase": []
    },
    {
      "DuplicateEntry": []
    },
    {
      "GuardianExcluded": []
    }
  ]
}
Return
None

Parameters
[
  "<UInt8>"
]
Errors
{
  "Enum": [
    {
      "ParseParams": []
    },
    {
      "Unauthorized": []
    },
    {
      "Malformed": []
    },
    {
      "IncorrectElectionPhase": []
    },
    {
      "DuplicateEntry": []
    },
    {
      "GuardianExcluded": []
    }
  ]
}
Return
None

Parameters
[
  "<UInt8>"
]
Errors
{
  "Enum": [
    {
      "ParseParams": []
    },
    {
      "Unauthorized": []
    },
    {
      "Malformed": []
    },
    {
      "IncorrectElectionPhase": []
    },
    {
      "DuplicateEntry": []
    },
    {
      "GuardianExcluded": []
    }
  ]
}
Return
None

Parameters
[
  "<UInt8>"
]
Errors
{
  "Enum": [
    {
      "ParseParams": []
    },
    {
      "Unauthorized": []
    },
    {
      "Malformed": []
    },
    {
      "IncorrectElectionPhase": []
    },
    {
      "DuplicateEntry": []
    },
    {
      "GuardianExcluded": []
    }
  ]
}
Return
None

Parameters
{
  "Enum": [
    {
      "KeyVerificationFailed": [
        [
          "<AccountAddress>"
        ]
      ]
    },
    {
      "SharesVerificationFailed": [
        [
          "<AccountAddress>"
        ]
      ]
    },
    {
      "VerificationSuccessful": []
    }
  ]
}
Errors
{
  "Enum": [
    {
      "ParseParams": []
    },
    {
      "Unauthorized": []
    },
    {
      "Malformed": []
    },
    {
      "IncorrectElectionPhase": []
    },
    {
      "DuplicateEntry": []
    },
    {
      "GuardianExcluded": []
    }
  ]
}
Return
None

Parameters
None
Errors
None
Return
[
  [
    "<AccountAddress>",
    {
      "decryption_share": {
        "Enum": [
          {
            "None": []
          },
          {
            "Some": [
              [
                "<UInt8>"
              ]
            ]
          }
        ]
      },
      "decryption_share_proof": {
        "Enum": [
          {
            "None": []
          },
          {
            "Some": [
              [
                "<UInt8>"
              ]
            ]
          }
        ]
      },
      "encrypted_share": {
        "Enum": [
          {
            "None": []
          },
          {
            "Some": [
              [
                "<UInt8>"
              ]
            ]
          }
        ]
      },
      "excluded": "<Bool>",
      "index": "<UInt32>",
      "public_key": {
        "Enum": [
          {
            "None": []
          },
          {
            "Some": [
              [
                "<UInt8>"
              ]
            ]
          }
        ]
      },
      "status": {
        "Enum": [
          {
            "None": []
          },
          {
            "Some": [
              {
                "Enum": [
                  {
                    "KeyVerificationFailed": [
                      [
                        "<AccountAddress>"
                      ]
                    ]
                  },
                  {
                    "SharesVerificationFailed": [
                      [
                        "<AccountAddress>"
                      ]
                    ]
                  },
                  {
                    "VerificationSuccessful": []
                  }
                ]
              }
            ]
          }
        ]
      }
    }
  ]
]

Parameters
"<String with lowercase hex>"
Errors
{
  "Enum": [
    {
      "ParseParams": []
    },
    {
      "Unauthorized": []
    },
    {
      "Malformed": []
    },
    {
      "IncorrectElectionPhase": []
    },
    {
      "DuplicateEntry": []
    },
    {
      "GuardianExcluded": []
    }
  ]
}
Return
None

Parameters
[
  "<UInt8>"
]
Errors
{
  "Enum": [
    {
      "ParseParams": []
    },
    {
      "Unauthorized": []
    },
    {
      "Malformed": []
    },
    {
      "IncorrectElectionPhase": []
    },
    {
      "DuplicateEntry": []
    },
    {
      "GuardianExcluded": []
    }
  ]
}
Return
None

Parameters
[
  "<UInt64>"
]
Errors
{
  "Enum": [
    {
      "ParseParams": []
    },
    {
      "Unauthorized": []
    },
    {
      "Malformed": []
    },
    {
      "IncorrectElectionPhase": []
    },
    {
      "DuplicateEntry": []
    },
    {
      "GuardianExcluded": []
    }
  ]
}
Return
None

Parameters
[
  [
    "<AccountAddress>"
  ],
  "<Timestamp (e.g. `2000-01-01T12:00:00Z`)>"
]
Errors
{
  "Enum": [
    {
      "ParseParams": []
    },
    {
      "Unauthorized": []
    },
    {
      "Malformed": []
    },
    {
      "IncorrectElectionPhase": []
    },
    {
      "DuplicateEntry": []
    },
    {
      "GuardianExcluded": []
    }
  ]
}
Return
None

Parameters
None
Errors
None
Return
{
  "admin_account": "<AccountAddress>",
  "candidates": [
    {
      "hash": "<String of size 64 containing lowercase hex characters.>",
      "url": "<String>"
    }
  ],
  "decryption_deadline": "<Timestamp (e.g. `2000-01-01T12:00:00Z`)>",
  "delegation_string": "<String>",
  "election_description": "<String>",
  "election_end": "<Timestamp (e.g. `2000-01-01T12:00:00Z`)>",
  "election_manifest": {
    "hash": "<String of size 64 containing lowercase hex characters.>",
    "url": "<String>"
  },
  "election_parameters": {
    "hash": "<String of size 64 containing lowercase hex characters.>",
    "url": "<String>"
  },
  "election_start": "<Timestamp (e.g. `2000-01-01T12:00:00Z`)>",
  "eligible_voters": {
    "data": {
      "hash": "<String of size 64 containing lowercase hex characters.>",
      "url": "<String>"
    },
    "parameters": {
      "end_time": "<Timestamp (e.g. `2000-01-01T12:00:00Z`)>",
      "start_time": "<Timestamp (e.g. `2000-01-01T12:00:00Z`)>"
    }
  },
  "guardian_accounts": [
    "<AccountAddress>"
  ]
}

Parameters
None
Errors
{
  "Enum": [
    {
      "ParseParams": []
    },
    {
      "Unauthorized": []
    },
    {
      "Malformed": []
    },
    {
      "IncorrectElectionPhase": []
    },
    {
      "DuplicateEntry": []
    },
    {
      "GuardianExcluded": []
    }
  ]
}
Return
{
  "Enum": [
    {
      "None": []
    },
    {
      "Some": [
        [
          {
            "candidate": {
              "hash": "<String of size 64 containing lowercase hex characters.>",
              "url": "<String>"
            },
            "cummulative_votes": "<UInt64>"
          }
        ]
      ]
    }
  ]
}

Parameters
None
Errors
{
  "Enum": [
    {
      "ParseParams": []
    },
    {
      "Unauthorized": []
    },
    {
      "Malformed": []
    },
    {
      "IncorrectElectionPhase": []
    },
    {
      "DuplicateEntry": []
    },
    {
      "GuardianExcluded": []
    }
  ]
}
Return
{
  "Enum": [
    {
      "None": []
    },
    {
      "Some": [
        [
          "<UInt8>"
        ]
      ]
    }
  ]
}


Release: 2024.12
Support CCDExplorer.io Uptime Backend Status