Expand description
Generated by the following Solidity interface…
library Time {
type Timestamp is uint64;
}
interface Voting {
struct VotingInfo {
uint256 threshold;
Time.Timestamp deadline;
uint256 nonce;
address owner;
}
event Voted(bytes32 indexed votingId, address indexed voter, uint256 indexed choice);
event Winner(bytes32 indexed votingId, uint256 indexed choice);
function register(VotingInfo memory v) external;
function setWinner(VotingInfo memory v, uint256 choice) external;
function vote(VotingInfo memory v, uint256 choice) external;
function votingId(VotingInfo memory v) external pure returns (bytes32);
}…which was generated by the following JSON ABI:
[
{
"type": "function",
"name": "register",
"inputs": [
{
"name": "v",
"type": "tuple",
"internalType": "struct Voting.VotingInfo",
"components": [
{
"name": "threshold",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "deadline",
"type": "uint64",
"internalType": "Time.Timestamp"
},
{
"name": "nonce",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "owner",
"type": "address",
"internalType": "address"
}
]
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "setWinner",
"inputs": [
{
"name": "v",
"type": "tuple",
"internalType": "struct Voting.VotingInfo",
"components": [
{
"name": "threshold",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "deadline",
"type": "uint64",
"internalType": "Time.Timestamp"
},
{
"name": "nonce",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "owner",
"type": "address",
"internalType": "address"
}
]
},
{
"name": "choice",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "vote",
"inputs": [
{
"name": "v",
"type": "tuple",
"internalType": "struct Voting.VotingInfo",
"components": [
{
"name": "threshold",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "deadline",
"type": "uint64",
"internalType": "Time.Timestamp"
},
{
"name": "nonce",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "owner",
"type": "address",
"internalType": "address"
}
]
},
{
"name": "choice",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "votingId",
"inputs": [
{
"name": "v",
"type": "tuple",
"internalType": "struct Voting.VotingInfo",
"components": [
{
"name": "threshold",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "deadline",
"type": "uint64",
"internalType": "Time.Timestamp"
},
{
"name": "nonce",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "owner",
"type": "address",
"internalType": "address"
}
]
}
],
"outputs": [
{
"name": "",
"type": "bytes32",
"internalType": "bytes32"
}
],
"stateMutability": "pure"
},
{
"type": "event",
"name": "Voted",
"inputs": [
{
"name": "votingId",
"type": "bytes32",
"indexed": true,
"internalType": "bytes32"
},
{
"name": "voter",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "choice",
"type": "uint256",
"indexed": true,
"internalType": "uint256"
}
],
"anonymous": false
},
{
"type": "event",
"name": "Winner",
"inputs": [
{
"name": "votingId",
"type": "bytes32",
"indexed": true,
"internalType": "bytes32"
},
{
"name": "choice",
"type": "uint256",
"indexed": true,
"internalType": "uint256"
}
],
"anonymous": false
}
]Structs§
- Voted
- Event with signature
Voted(bytes32,address,uint256)and selector0xe4abc5380fa6939d1dc23b5e90b3a8a0e328f0f1a82a5f42bfb795bf9c717505. - Voting
Info - Voting
Instance - A
Votinginstance. - Winner
- Event with signature
Winner(bytes32,uint256)and selector0x269d3a24712436f77df15d63de7d2337a060c9102dee6f46c909fb0fa2d52f0c. - register
Call - Function with signature
register((uint256,uint64,uint256,address))and selector0x995d5d91. - register
Return - Container type for the return parameters of the
register((uint256,uint64,uint256,address))function. - setWinner
Call - Function with signature
setWinner((uint256,uint64,uint256,address),uint256)and selector0xe8021822. - setWinner
Return - Container type for the return parameters of the
setWinner((uint256,uint64,uint256,address),uint256)function. - vote
Call - Function with signature
vote((uint256,uint64,uint256,address),uint256)and selector0xa7d4c473. - vote
Return - Container type for the return parameters of the
vote((uint256,uint64,uint256,address),uint256)function. - voting
IdCall - Function with signature
votingId((uint256,uint64,uint256,address))and selector0x24c6e3c4. - voting
IdReturn - Container type for the return parameters of the
votingId((uint256,uint64,uint256,address))function.
Enums§
- Voting
Calls - Container for all the
Votingfunction calls. - Voting
Events - Container for all the
Votingevents.
Statics§
- BYTECODE
- The creation / init bytecode of the contract.
- DEPLOYED_
BYTECODE - The runtime bytecode of the contract, as deployed on the network.
Functions§
- deploy
- Deploys this contract using the given
providerand constructor arguments, if any. - deploy_
builder - Creates a
RawCallBuilderfor deploying this contract using the givenproviderand constructor arguments, if any. - new
- Creates a new wrapper around an on-chain
Votingcontract instance.