Skip to content

Instantly share code, notes, and snippets.

@soyHouston256
Created December 1, 2021 21:15
Show Gist options
  • Save soyHouston256/5fb3242e165909fb172a52ffda85ebe9 to your computer and use it in GitHub Desktop.
Save soyHouston256/5fb3242e165909fb172a52ffda85ebe9 to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
REMIX EXAMPLE PROJECT
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer.
It contains 3 directories:
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name.
2. 'scripts': Holds two scripts to deploy a contract. It is explained below.
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity.
SCRIPTS
The 'scripts' folder contains example async/await scripts for deploying the 'Storage' contract.
For the deployment of any other contract, 'contractName' and 'constructorArgs' should be updated (along with other code if required).
Scripts have full access to the web3.js and ethers.js libraries.
To run a script, right click on file name in the file explorer and click 'Run'. Remember, Solidity file must already be compiled.
Output from script will appear in remix terminal.
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/**
* @title Storage
* @dev Store & retrieve value in a variable
*/
contract Storage {
uint256 number;
/**
* @dev Store value in variable
* @param num value to store
*/
function store(uint256 num) public {
number = num;
}
/**
* @dev Return value
* @return value of 'number'
*/
function retrieve() public view returns (uint256){
return number;
}
}
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/**
* @title Owner
* @dev Set & change owner
*/
contract Owner {
address private owner;
// event for EVM logging
event OwnerSet(address indexed oldOwner, address indexed newOwner);
// modifier to check if caller is owner
modifier isOwner() {
// If the first argument of 'require' evaluates to 'false', execution terminates and all
// changes to the state and to Ether balances are reverted.
// This used to consume all gas in old EVM versions, but not anymore.
// It is often a good idea to use 'require' to check if functions are called correctly.
// As a second argument, you can also provide an explanation about what went wrong.
require(msg.sender == owner, "Caller is not owner");
_;
}
/**
* @dev Set contract deployer as owner
*/
constructor() {
owner = msg.sender; // 'msg.sender' is sender of current call, contract deployer for a constructor
emit OwnerSet(address(0), owner);
}
/**
* @dev Change owner
* @param newOwner address of new owner
*/
function changeOwner(address newOwner) public isOwner {
emit OwnerSet(owner, newOwner);
owner = newOwner;
}
/**
* @dev Return owner address
* @return address of owner
*/
function getOwner() external view returns (address) {
return owner;
}
}
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/**
* @title Ballot
* @dev Implements voting process along with vote delegation
*/
contract Ballot {
struct Voter {
uint weight; // weight is accumulated by delegation
bool voted; // if true, that person already voted
address delegate; // person delegated to
uint vote; // index of the voted proposal
}
struct Proposal {
// If you can limit the length to a certain number of bytes,
// always use one of bytes1 to bytes32 because they are much cheaper
bytes32 name; // short name (up to 32 bytes)
uint voteCount; // number of accumulated votes
}
address public chairperson;
mapping(address => Voter) public voters;
Proposal[] public proposals;
/**
* @dev Create a new ballot to choose one of 'proposalNames'.
* @param proposalNames names of proposals
*/
constructor(bytes32[] memory proposalNames) {
chairperson = msg.sender;
voters[chairperson].weight = 1;
for (uint i = 0; i < proposalNames.length; i++) {
// 'Proposal({...})' creates a temporary
// Proposal object and 'proposals.push(...)'
// appends it to the end of 'proposals'.
proposals.push(Proposal({
name: proposalNames[i],
voteCount: 0
}));
}
}
/**
* @dev Give 'voter' the right to vote on this ballot. May only be called by 'chairperson'.
* @param voter address of voter
*/
function giveRightToVote(address voter) public {
require(
msg.sender == chairperson,
"Only chairperson can give right to vote."
);
require(
!voters[voter].voted,
"The voter already voted."
);
require(voters[voter].weight == 0);
voters[voter].weight = 1;
}
/**
* @dev Delegate your vote to the voter 'to'.
* @param to address to which vote is delegated
*/
function delegate(address to) public {
Voter storage sender = voters[msg.sender];
require(!sender.voted, "You already voted.");
require(to != msg.sender, "Self-delegation is disallowed.");
while (voters[to].delegate != address(0)) {
to = voters[to].delegate;
// We found a loop in the delegation, not allowed.
require(to != msg.sender, "Found loop in delegation.");
}
sender.voted = true;
sender.delegate = to;
Voter storage delegate_ = voters[to];
if (delegate_.voted) {
// If the delegate already voted,
// directly add to the number of votes
proposals[delegate_.vote].voteCount += sender.weight;
} else {
// If the delegate did not vote yet,
// add to her weight.
delegate_.weight += sender.weight;
}
}
/**
* @dev Give your vote (including votes delegated to you) to proposal 'proposals[proposal].name'.
* @param proposal index of proposal in the proposals array
*/
function vote(uint proposal) public {
Voter storage sender = voters[msg.sender];
require(sender.weight != 0, "Has no right to vote");
require(!sender.voted, "Already voted.");
sender.voted = true;
sender.vote = proposal;
// If 'proposal' is out of the range of the array,
// this will throw automatically and revert all
// changes.
proposals[proposal].voteCount += sender.weight;
}
/**
* @dev Computes the winning proposal taking all previous votes into account.
* @return winningProposal_ index of winning proposal in the proposals array
*/
function winningProposal() public view
returns (uint winningProposal_)
{
uint winningVoteCount = 0;
for (uint p = 0; p < proposals.length; p++) {
if (proposals[p].voteCount > winningVoteCount) {
winningVoteCount = proposals[p].voteCount;
winningProposal_ = p;
}
}
}
/**
* @dev Calls winningProposal() function to get the index of the winner contained in the proposals array and then
* @return winnerName_ the name of the winner
*/
function winnerName() public view
returns (bytes32 winnerName_)
{
winnerName_ = proposals[winningProposal()].name;
}
}
{
"deploy": {
"VM:-": {
"linkReferences": {},
"autoDeployLib": true
},
"main:1": {
"linkReferences": {},
"autoDeployLib": true
},
"ropsten:3": {
"linkReferences": {},
"autoDeployLib": true
},
"rinkeby:4": {
"linkReferences": {},
"autoDeployLib": true
},
"kovan:42": {
"linkReferences": {},
"autoDeployLib": true
},
"görli:5": {
"linkReferences": {},
"autoDeployLib": true
},
"Custom": {
"linkReferences": {},
"autoDeployLib": true
}
},
"data": {
"bytecode": {
"functionDebugData": {
"@_23": {
"entryPoint": null,
"id": 23,
"parameterSlots": 0,
"returnSlots": 0
},
"extract_byte_array_length": {
"entryPoint": 346,
"id": null,
"parameterSlots": 1,
"returnSlots": 1
},
"panic_error_0x22": {
"entryPoint": 396,
"id": null,
"parameterSlots": 0,
"returnSlots": 0
}
},
"generatedSources": [
{
"ast": {
"nodeType": "YulBlock",
"src": "0:516:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "58:269:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "68:22:1",
"value": {
"arguments": [
{
"name": "data",
"nodeType": "YulIdentifier",
"src": "82:4:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "88:1:1",
"type": "",
"value": "2"
}
],
"functionName": {
"name": "div",
"nodeType": "YulIdentifier",
"src": "78:3:1"
},
"nodeType": "YulFunctionCall",
"src": "78:12:1"
},
"variableNames": [
{
"name": "length",
"nodeType": "YulIdentifier",
"src": "68:6:1"
}
]
},
{
"nodeType": "YulVariableDeclaration",
"src": "99:38:1",
"value": {
"arguments": [
{
"name": "data",
"nodeType": "YulIdentifier",
"src": "129:4:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "135:1:1",
"type": "",
"value": "1"
}
],
"functionName": {
"name": "and",
"nodeType": "YulIdentifier",
"src": "125:3:1"
},
"nodeType": "YulFunctionCall",
"src": "125:12:1"
},
"variables": [
{
"name": "outOfPlaceEncoding",
"nodeType": "YulTypedName",
"src": "103:18:1",
"type": ""
}
]
},
{
"body": {
"nodeType": "YulBlock",
"src": "176:51:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "190:27:1",
"value": {
"arguments": [
{
"name": "length",
"nodeType": "YulIdentifier",
"src": "204:6:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "212:4:1",
"type": "",
"value": "0x7f"
}
],
"functionName": {
"name": "and",
"nodeType": "YulIdentifier",
"src": "200:3:1"
},
"nodeType": "YulFunctionCall",
"src": "200:17:1"
},
"variableNames": [
{
"name": "length",
"nodeType": "YulIdentifier",
"src": "190:6:1"
}
]
}
]
},
"condition": {
"arguments": [
{
"name": "outOfPlaceEncoding",
"nodeType": "YulIdentifier",
"src": "156:18:1"
}
],
"functionName": {
"name": "iszero",
"nodeType": "YulIdentifier",
"src": "149:6:1"
},
"nodeType": "YulFunctionCall",
"src": "149:26:1"
},
"nodeType": "YulIf",
"src": "146:81:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "279:42:1",
"statements": [
{
"expression": {
"arguments": [],
"functionName": {
"name": "panic_error_0x22",
"nodeType": "YulIdentifier",
"src": "293:16:1"
},
"nodeType": "YulFunctionCall",
"src": "293:18:1"
},
"nodeType": "YulExpressionStatement",
"src": "293:18:1"
}
]
},
"condition": {
"arguments": [
{
"name": "outOfPlaceEncoding",
"nodeType": "YulIdentifier",
"src": "243:18:1"
},
{
"arguments": [
{
"name": "length",
"nodeType": "YulIdentifier",
"src": "266:6:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "274:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "lt",
"nodeType": "YulIdentifier",
"src": "263:2:1"
},
"nodeType": "YulFunctionCall",
"src": "263:14:1"
}
],
"functionName": {
"name": "eq",
"nodeType": "YulIdentifier",
"src": "240:2:1"
},
"nodeType": "YulFunctionCall",
"src": "240:38:1"
},
"nodeType": "YulIf",
"src": "237:84:1"
}
]
},
"name": "extract_byte_array_length",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "data",
"nodeType": "YulTypedName",
"src": "42:4:1",
"type": ""
}
],
"returnVariables": [
{
"name": "length",
"nodeType": "YulTypedName",
"src": "51:6:1",
"type": ""
}
],
"src": "7:320:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "361:152:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "378:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "381:77:1",
"type": "",
"value": "35408467139433450592217433187231851964531694900788300625387963629091585785856"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "371:6:1"
},
"nodeType": "YulFunctionCall",
"src": "371:88:1"
},
"nodeType": "YulExpressionStatement",
"src": "371:88:1"
},
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "475:1:1",
"type": "",
"value": "4"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "478:4:1",
"type": "",
"value": "0x22"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "468:6:1"
},
"nodeType": "YulFunctionCall",
"src": "468:15:1"
},
"nodeType": "YulExpressionStatement",
"src": "468:15:1"
},
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "499:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "502:4:1",
"type": "",
"value": "0x24"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "492:6:1"
},
"nodeType": "YulFunctionCall",
"src": "492:15:1"
},
"nodeType": "YulExpressionStatement",
"src": "492:15:1"
}
]
},
"name": "panic_error_0x22",
"nodeType": "YulFunctionDefinition",
"src": "333:180:1"
}
]
},
"contents": "{\n\n function extract_byte_array_length(data) -> length {\n length := div(data, 2)\n let outOfPlaceEncoding := and(data, 1)\n if iszero(outOfPlaceEncoding) {\n length := and(length, 0x7f)\n }\n\n if eq(outOfPlaceEncoding, lt(length, 32)) {\n panic_error_0x22()\n }\n }\n\n function panic_error_0x22() {\n mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)\n mstore(4, 0x22)\n revert(0, 0x24)\n }\n\n}\n",
"id": 1,
"language": "Yul",
"name": "#utility.yul"
}
],
"linkReferences": {},
"object": "608060405234801561001057600080fd5b50600060405180604001604052806040518060400160405280600481526020017f4a75616e0000000000000000000000000000000000000000000000000000000081525081526020016247ac87815250908060018154018082558091505060019003906000526020600020906002020160009091909190915060008201518160000190805190602001906100a59291906100b7565b506020820151816001015550506101bb565b8280546100c39061015a565b90600052602060002090601f0160209004810192826100e5576000855561012c565b82601f106100fe57805160ff191683800117855561012c565b8280016001018555821561012c579182015b8281111561012b578251825591602001919060010190610110565b5b509050610139919061013d565b5090565b5b8082111561015657600081600090555060010161013e565b5090565b6000600282049050600182168061017257607f821691505b602082108114156101865761018561018c565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6102f4806101ca6000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c806369ddcade14610030575b600080fd5b61004a60048036038101906100459190610132565b610061565b6040516100589291906101a7565b60405180910390f35b6000818154811061007157600080fd5b906000526020600020906002020160009150905080600001805461009490610230565b80601f01602080910402602001604051908101604052809291908181526020018280546100c090610230565b801561010d5780601f106100e25761010080835404028352916020019161010d565b820191906000526020600020905b8154815290600101906020018083116100f057829003601f168201915b5050505050908060010154905082565b60008135905061012c816102a7565b92915050565b60006020828403121561014857610147610291565b5b60006101568482850161011d565b91505092915050565b600061016a826101d7565b61017481856101e2565b93506101848185602086016101fd565b61018d81610296565b840191505092915050565b6101a1816101f3565b82525050565b600060408201905081810360008301526101c1818561015f565b90506101d06020830184610198565b9392505050565b600081519050919050565b600082825260208201905092915050565b6000819050919050565b60005b8381101561021b578082015181840152602081019050610200565b8381111561022a576000848401525b50505050565b6000600282049050600182168061024857607f821691505b6020821081141561025c5761025b610262565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600080fd5b6000601f19601f8301169050919050565b6102b0816101f3565b81146102bb57600080fd5b5056fea26469706673582212202dd0fc778d71b1571f62fabc146b35b02b95aa18b6b4932392871dcaeffd4bc064736f6c63430008070033",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 PUSH1 0x40 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x40 MLOAD DUP1 PUSH1 0x40 ADD PUSH1 0x40 MSTORE DUP1 PUSH1 0x4 DUP2 MSTORE PUSH1 0x20 ADD PUSH32 0x4A75616E00000000000000000000000000000000000000000000000000000000 DUP2 MSTORE POP DUP2 MSTORE PUSH1 0x20 ADD PUSH3 0x47AC87 DUP2 MSTORE POP SWAP1 DUP1 PUSH1 0x1 DUP2 SLOAD ADD DUP1 DUP3 SSTORE DUP1 SWAP2 POP POP PUSH1 0x1 SWAP1 SUB SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x2 MUL ADD PUSH1 0x0 SWAP1 SWAP2 SWAP1 SWAP2 SWAP1 SWAP2 POP PUSH1 0x0 DUP3 ADD MLOAD DUP2 PUSH1 0x0 ADD SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH2 0xA5 SWAP3 SWAP2 SWAP1 PUSH2 0xB7 JUMP JUMPDEST POP PUSH1 0x20 DUP3 ADD MLOAD DUP2 PUSH1 0x1 ADD SSTORE POP POP PUSH2 0x1BB JUMP JUMPDEST DUP3 DUP1 SLOAD PUSH2 0xC3 SWAP1 PUSH2 0x15A JUMP JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x1F ADD PUSH1 0x20 SWAP1 DIV DUP2 ADD SWAP3 DUP3 PUSH2 0xE5 JUMPI PUSH1 0x0 DUP6 SSTORE PUSH2 0x12C JUMP JUMPDEST DUP3 PUSH1 0x1F LT PUSH2 0xFE JUMPI DUP1 MLOAD PUSH1 0xFF NOT AND DUP4 DUP1 ADD OR DUP6 SSTORE PUSH2 0x12C JUMP JUMPDEST DUP3 DUP1 ADD PUSH1 0x1 ADD DUP6 SSTORE DUP3 ISZERO PUSH2 0x12C JUMPI SWAP2 DUP3 ADD JUMPDEST DUP3 DUP2 GT ISZERO PUSH2 0x12B JUMPI DUP3 MLOAD DUP3 SSTORE SWAP2 PUSH1 0x20 ADD SWAP2 SWAP1 PUSH1 0x1 ADD SWAP1 PUSH2 0x110 JUMP JUMPDEST JUMPDEST POP SWAP1 POP PUSH2 0x139 SWAP2 SWAP1 PUSH2 0x13D JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST JUMPDEST DUP1 DUP3 GT ISZERO PUSH2 0x156 JUMPI PUSH1 0x0 DUP2 PUSH1 0x0 SWAP1 SSTORE POP PUSH1 0x1 ADD PUSH2 0x13E JUMP JUMPDEST POP SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x2 DUP3 DIV SWAP1 POP PUSH1 0x1 DUP3 AND DUP1 PUSH2 0x172 JUMPI PUSH1 0x7F DUP3 AND SWAP2 POP JUMPDEST PUSH1 0x20 DUP3 LT DUP2 EQ ISZERO PUSH2 0x186 JUMPI PUSH2 0x185 PUSH2 0x18C JUMP JUMPDEST JUMPDEST POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x22 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH2 0x2F4 DUP1 PUSH2 0x1CA PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x2B JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x69DDCADE EQ PUSH2 0x30 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4A PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x45 SWAP2 SWAP1 PUSH2 0x132 JUMP JUMPDEST PUSH2 0x61 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x58 SWAP3 SWAP2 SWAP1 PUSH2 0x1A7 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x0 DUP2 DUP2 SLOAD DUP2 LT PUSH2 0x71 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x2 MUL ADD PUSH1 0x0 SWAP2 POP SWAP1 POP DUP1 PUSH1 0x0 ADD DUP1 SLOAD PUSH2 0x94 SWAP1 PUSH2 0x230 JUMP JUMPDEST DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH2 0xC0 SWAP1 PUSH2 0x230 JUMP JUMPDEST DUP1 ISZERO PUSH2 0x10D JUMPI DUP1 PUSH1 0x1F LT PUSH2 0xE2 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x10D JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xF0 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 DUP1 PUSH1 0x1 ADD SLOAD SWAP1 POP DUP3 JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0x12C DUP2 PUSH2 0x2A7 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x148 JUMPI PUSH2 0x147 PUSH2 0x291 JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH2 0x156 DUP5 DUP3 DUP6 ADD PUSH2 0x11D JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x16A DUP3 PUSH2 0x1D7 JUMP JUMPDEST PUSH2 0x174 DUP2 DUP6 PUSH2 0x1E2 JUMP JUMPDEST SWAP4 POP PUSH2 0x184 DUP2 DUP6 PUSH1 0x20 DUP7 ADD PUSH2 0x1FD JUMP JUMPDEST PUSH2 0x18D DUP2 PUSH2 0x296 JUMP JUMPDEST DUP5 ADD SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x1A1 DUP2 PUSH2 0x1F3 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x1C1 DUP2 DUP6 PUSH2 0x15F JUMP JUMPDEST SWAP1 POP PUSH2 0x1D0 PUSH1 0x20 DUP4 ADD DUP5 PUSH2 0x198 JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x21B JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x200 JUMP JUMPDEST DUP4 DUP2 GT ISZERO PUSH2 0x22A JUMPI PUSH1 0x0 DUP5 DUP5 ADD MSTORE JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x2 DUP3 DIV SWAP1 POP PUSH1 0x1 DUP3 AND DUP1 PUSH2 0x248 JUMPI PUSH1 0x7F DUP3 AND SWAP2 POP JUMPDEST PUSH1 0x20 DUP3 LT DUP2 EQ ISZERO PUSH2 0x25C JUMPI PUSH2 0x25B PUSH2 0x262 JUMP JUMPDEST JUMPDEST POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x22 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x1F NOT PUSH1 0x1F DUP4 ADD AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x2B0 DUP2 PUSH2 0x1F3 JUMP JUMPDEST DUP2 EQ PUSH2 0x2BB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0x2D 0xD0 0xFC PUSH24 0x8D71B1571F62FABC146B35B02B95AA18B6B4932392871DCA 0xEF REVERT 0x4B 0xC0 PUSH5 0x736F6C6343 STOP ADDMOD SMOD STOP CALLER ",
"sourceMap": "68:211:0:-:0;;;191:86;;;;;;;;;;214:7;227:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;260:7;227:42;;;214:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;68:211;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;:::o;7:320:1:-;51:6;88:1;82:4;78:12;68:22;;135:1;129:4;125:12;156:18;146:81;;212:4;204:6;200:17;190:27;;146:81;274:2;266:6;263:14;243:18;240:38;237:84;;;293:18;;:::i;:::-;237:84;58:269;7:320;;;:::o;333:180::-;381:77;378:1;371:88;478:4;475:1;468:15;502:4;499:1;492:15;68:211:0;;;;;;;"
},
"deployedBytecode": {
"functionDebugData": {
"@alumnos_10": {
"entryPoint": 97,
"id": 10,
"parameterSlots": 0,
"returnSlots": 0
},
"abi_decode_t_uint256": {
"entryPoint": 285,
"id": null,
"parameterSlots": 2,
"returnSlots": 1
},
"abi_decode_tuple_t_uint256": {
"entryPoint": 306,
"id": null,
"parameterSlots": 2,
"returnSlots": 1
},
"abi_encode_t_string_memory_ptr_to_t_string_memory_ptr_fromStack": {
"entryPoint": 351,
"id": null,
"parameterSlots": 2,
"returnSlots": 1
},
"abi_encode_t_uint256_to_t_uint256_fromStack": {
"entryPoint": 408,
"id": null,
"parameterSlots": 2,
"returnSlots": 0
},
"abi_encode_tuple_t_string_memory_ptr_t_uint256__to_t_string_memory_ptr_t_uint256__fromStack_reversed": {
"entryPoint": 423,
"id": null,
"parameterSlots": 3,
"returnSlots": 1
},
"allocate_unbounded": {
"entryPoint": null,
"id": null,
"parameterSlots": 0,
"returnSlots": 1
},
"array_length_t_string_memory_ptr": {
"entryPoint": 471,
"id": null,
"parameterSlots": 1,
"returnSlots": 1
},
"array_storeLengthForEncoding_t_string_memory_ptr_fromStack": {
"entryPoint": 482,
"id": null,
"parameterSlots": 2,
"returnSlots": 1
},
"cleanup_t_uint256": {
"entryPoint": 499,
"id": null,
"parameterSlots": 1,
"returnSlots": 1
},
"copy_memory_to_memory": {
"entryPoint": 509,
"id": null,
"parameterSlots": 3,
"returnSlots": 0
},
"extract_byte_array_length": {
"entryPoint": 560,
"id": null,
"parameterSlots": 1,
"returnSlots": 1
},
"panic_error_0x22": {
"entryPoint": 610,
"id": null,
"parameterSlots": 0,
"returnSlots": 0
},
"revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db": {
"entryPoint": null,
"id": null,
"parameterSlots": 0,
"returnSlots": 0
},
"revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b": {
"entryPoint": 657,
"id": null,
"parameterSlots": 0,
"returnSlots": 0
},
"round_up_to_mul_of_32": {
"entryPoint": 662,
"id": null,
"parameterSlots": 1,
"returnSlots": 1
},
"validator_revert_t_uint256": {
"entryPoint": 679,
"id": null,
"parameterSlots": 1,
"returnSlots": 0
}
},
"generatedSources": [
{
"ast": {
"nodeType": "YulBlock",
"src": "0:3158:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "59:87:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "69:29:1",
"value": {
"arguments": [
{
"name": "offset",
"nodeType": "YulIdentifier",
"src": "91:6:1"
}
],
"functionName": {
"name": "calldataload",
"nodeType": "YulIdentifier",
"src": "78:12:1"
},
"nodeType": "YulFunctionCall",
"src": "78:20:1"
},
"variableNames": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "69:5:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "134:5:1"
}
],
"functionName": {
"name": "validator_revert_t_uint256",
"nodeType": "YulIdentifier",
"src": "107:26:1"
},
"nodeType": "YulFunctionCall",
"src": "107:33:1"
},
"nodeType": "YulExpressionStatement",
"src": "107:33:1"
}
]
},
"name": "abi_decode_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "offset",
"nodeType": "YulTypedName",
"src": "37:6:1",
"type": ""
},
{
"name": "end",
"nodeType": "YulTypedName",
"src": "45:3:1",
"type": ""
}
],
"returnVariables": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "53:5:1",
"type": ""
}
],
"src": "7:139:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "218:263:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "264:83:1",
"statements": [
{
"expression": {
"arguments": [],
"functionName": {
"name": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b",
"nodeType": "YulIdentifier",
"src": "266:77:1"
},
"nodeType": "YulFunctionCall",
"src": "266:79:1"
},
"nodeType": "YulExpressionStatement",
"src": "266:79:1"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "239:7:1"
},
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "248:9:1"
}
],
"functionName": {
"name": "sub",
"nodeType": "YulIdentifier",
"src": "235:3:1"
},
"nodeType": "YulFunctionCall",
"src": "235:23:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "260:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "slt",
"nodeType": "YulIdentifier",
"src": "231:3:1"
},
"nodeType": "YulFunctionCall",
"src": "231:32:1"
},
"nodeType": "YulIf",
"src": "228:119:1"
},
{
"nodeType": "YulBlock",
"src": "357:117:1",
"statements": [
{
"nodeType": "YulVariableDeclaration",
"src": "372:15:1",
"value": {
"kind": "number",
"nodeType": "YulLiteral",
"src": "386:1:1",
"type": "",
"value": "0"
},
"variables": [
{
"name": "offset",
"nodeType": "YulTypedName",
"src": "376:6:1",
"type": ""
}
]
},
{
"nodeType": "YulAssignment",
"src": "401:63:1",
"value": {
"arguments": [
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "436:9:1"
},
{
"name": "offset",
"nodeType": "YulIdentifier",
"src": "447:6:1"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "432:3:1"
},
"nodeType": "YulFunctionCall",
"src": "432:22:1"
},
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "456:7:1"
}
],
"functionName": {
"name": "abi_decode_t_uint256",
"nodeType": "YulIdentifier",
"src": "411:20:1"
},
"nodeType": "YulFunctionCall",
"src": "411:53:1"
},
"variableNames": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "401:6:1"
}
]
}
]
}
]
},
"name": "abi_decode_tuple_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "188:9:1",
"type": ""
},
{
"name": "dataEnd",
"nodeType": "YulTypedName",
"src": "199:7:1",
"type": ""
}
],
"returnVariables": [
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "211:6:1",
"type": ""
}
],
"src": "152:329:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "579:272:1",
"statements": [
{
"nodeType": "YulVariableDeclaration",
"src": "589:53:1",
"value": {
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "636:5:1"
}
],
"functionName": {
"name": "array_length_t_string_memory_ptr",
"nodeType": "YulIdentifier",
"src": "603:32:1"
},
"nodeType": "YulFunctionCall",
"src": "603:39:1"
},
"variables": [
{
"name": "length",
"nodeType": "YulTypedName",
"src": "593:6:1",
"type": ""
}
]
},
{
"nodeType": "YulAssignment",
"src": "651:78:1",
"value": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "717:3:1"
},
{
"name": "length",
"nodeType": "YulIdentifier",
"src": "722:6:1"
}
],
"functionName": {
"name": "array_storeLengthForEncoding_t_string_memory_ptr_fromStack",
"nodeType": "YulIdentifier",
"src": "658:58:1"
},
"nodeType": "YulFunctionCall",
"src": "658:71:1"
},
"variableNames": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "651:3:1"
}
]
},
{
"expression": {
"arguments": [
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "764:5:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "771:4:1",
"type": "",
"value": "0x20"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "760:3:1"
},
"nodeType": "YulFunctionCall",
"src": "760:16:1"
},
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "778:3:1"
},
{
"name": "length",
"nodeType": "YulIdentifier",
"src": "783:6:1"
}
],
"functionName": {
"name": "copy_memory_to_memory",
"nodeType": "YulIdentifier",
"src": "738:21:1"
},
"nodeType": "YulFunctionCall",
"src": "738:52:1"
},
"nodeType": "YulExpressionStatement",
"src": "738:52:1"
},
{
"nodeType": "YulAssignment",
"src": "799:46:1",
"value": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "810:3:1"
},
{
"arguments": [
{
"name": "length",
"nodeType": "YulIdentifier",
"src": "837:6:1"
}
],
"functionName": {
"name": "round_up_to_mul_of_32",
"nodeType": "YulIdentifier",
"src": "815:21:1"
},
"nodeType": "YulFunctionCall",
"src": "815:29:1"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "806:3:1"
},
"nodeType": "YulFunctionCall",
"src": "806:39:1"
},
"variableNames": [
{
"name": "end",
"nodeType": "YulIdentifier",
"src": "799:3:1"
}
]
}
]
},
"name": "abi_encode_t_string_memory_ptr_to_t_string_memory_ptr_fromStack",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "560:5:1",
"type": ""
},
{
"name": "pos",
"nodeType": "YulTypedName",
"src": "567:3:1",
"type": ""
}
],
"returnVariables": [
{
"name": "end",
"nodeType": "YulTypedName",
"src": "575:3:1",
"type": ""
}
],
"src": "487:364:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "922:53:1",
"statements": [
{
"expression": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "939:3:1"
},
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "962:5:1"
}
],
"functionName": {
"name": "cleanup_t_uint256",
"nodeType": "YulIdentifier",
"src": "944:17:1"
},
"nodeType": "YulFunctionCall",
"src": "944:24:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "932:6:1"
},
"nodeType": "YulFunctionCall",
"src": "932:37:1"
},
"nodeType": "YulExpressionStatement",
"src": "932:37:1"
}
]
},
"name": "abi_encode_t_uint256_to_t_uint256_fromStack",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "910:5:1",
"type": ""
},
{
"name": "pos",
"nodeType": "YulTypedName",
"src": "917:3:1",
"type": ""
}
],
"src": "857:118:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1127:277:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "1137:26:1",
"value": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "1149:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1160:2:1",
"type": "",
"value": "64"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "1145:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1145:18:1"
},
"variableNames": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "1137:4:1"
}
]
},
{
"expression": {
"arguments": [
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "1184:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1195:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "1180:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1180:17:1"
},
{
"arguments": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "1203:4:1"
},
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "1209:9:1"
}
],
"functionName": {
"name": "sub",
"nodeType": "YulIdentifier",
"src": "1199:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1199:20:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "1173:6:1"
},
"nodeType": "YulFunctionCall",
"src": "1173:47:1"
},
"nodeType": "YulExpressionStatement",
"src": "1173:47:1"
},
{
"nodeType": "YulAssignment",
"src": "1229:86:1",
"value": {
"arguments": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "1301:6:1"
},
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "1310:4:1"
}
],
"functionName": {
"name": "abi_encode_t_string_memory_ptr_to_t_string_memory_ptr_fromStack",
"nodeType": "YulIdentifier",
"src": "1237:63:1"
},
"nodeType": "YulFunctionCall",
"src": "1237:78:1"
},
"variableNames": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "1229:4:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "value1",
"nodeType": "YulIdentifier",
"src": "1369:6:1"
},
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "1382:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1393:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "1378:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1378:18:1"
}
],
"functionName": {
"name": "abi_encode_t_uint256_to_t_uint256_fromStack",
"nodeType": "YulIdentifier",
"src": "1325:43:1"
},
"nodeType": "YulFunctionCall",
"src": "1325:72:1"
},
"nodeType": "YulExpressionStatement",
"src": "1325:72:1"
}
]
},
"name": "abi_encode_tuple_t_string_memory_ptr_t_uint256__to_t_string_memory_ptr_t_uint256__fromStack_reversed",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "1091:9:1",
"type": ""
},
{
"name": "value1",
"nodeType": "YulTypedName",
"src": "1103:6:1",
"type": ""
},
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "1111:6:1",
"type": ""
}
],
"returnVariables": [
{
"name": "tail",
"nodeType": "YulTypedName",
"src": "1122:4:1",
"type": ""
}
],
"src": "981:423:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1450:35:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "1460:19:1",
"value": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1476:2:1",
"type": "",
"value": "64"
}
],
"functionName": {
"name": "mload",
"nodeType": "YulIdentifier",
"src": "1470:5:1"
},
"nodeType": "YulFunctionCall",
"src": "1470:9:1"
},
"variableNames": [
{
"name": "memPtr",
"nodeType": "YulIdentifier",
"src": "1460:6:1"
}
]
}
]
},
"name": "allocate_unbounded",
"nodeType": "YulFunctionDefinition",
"returnVariables": [
{
"name": "memPtr",
"nodeType": "YulTypedName",
"src": "1443:6:1",
"type": ""
}
],
"src": "1410:75:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1550:40:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "1561:22:1",
"value": {
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "1577:5:1"
}
],
"functionName": {
"name": "mload",
"nodeType": "YulIdentifier",
"src": "1571:5:1"
},
"nodeType": "YulFunctionCall",
"src": "1571:12:1"
},
"variableNames": [
{
"name": "length",
"nodeType": "YulIdentifier",
"src": "1561:6:1"
}
]
}
]
},
"name": "array_length_t_string_memory_ptr",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "1533:5:1",
"type": ""
}
],
"returnVariables": [
{
"name": "length",
"nodeType": "YulTypedName",
"src": "1543:6:1",
"type": ""
}
],
"src": "1491:99:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1692:73:1",
"statements": [
{
"expression": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "1709:3:1"
},
{
"name": "length",
"nodeType": "YulIdentifier",
"src": "1714:6:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "1702:6:1"
},
"nodeType": "YulFunctionCall",
"src": "1702:19:1"
},
"nodeType": "YulExpressionStatement",
"src": "1702:19:1"
},
{
"nodeType": "YulAssignment",
"src": "1730:29:1",
"value": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "1749:3:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1754:4:1",
"type": "",
"value": "0x20"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "1745:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1745:14:1"
},
"variableNames": [
{
"name": "updated_pos",
"nodeType": "YulIdentifier",
"src": "1730:11:1"
}
]
}
]
},
"name": "array_storeLengthForEncoding_t_string_memory_ptr_fromStack",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "pos",
"nodeType": "YulTypedName",
"src": "1664:3:1",
"type": ""
},
{
"name": "length",
"nodeType": "YulTypedName",
"src": "1669:6:1",
"type": ""
}
],
"returnVariables": [
{
"name": "updated_pos",
"nodeType": "YulTypedName",
"src": "1680:11:1",
"type": ""
}
],
"src": "1596:169:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1816:32:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "1826:16:1",
"value": {
"name": "value",
"nodeType": "YulIdentifier",
"src": "1837:5:1"
},
"variableNames": [
{
"name": "cleaned",
"nodeType": "YulIdentifier",
"src": "1826:7:1"
}
]
}
]
},
"name": "cleanup_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "1798:5:1",
"type": ""
}
],
"returnVariables": [
{
"name": "cleaned",
"nodeType": "YulTypedName",
"src": "1808:7:1",
"type": ""
}
],
"src": "1771:77:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1903:258:1",
"statements": [
{
"nodeType": "YulVariableDeclaration",
"src": "1913:10:1",
"value": {
"kind": "number",
"nodeType": "YulLiteral",
"src": "1922:1:1",
"type": "",
"value": "0"
},
"variables": [
{
"name": "i",
"nodeType": "YulTypedName",
"src": "1917:1:1",
"type": ""
}
]
},
{
"body": {
"nodeType": "YulBlock",
"src": "1982:63:1",
"statements": [
{
"expression": {
"arguments": [
{
"arguments": [
{
"name": "dst",
"nodeType": "YulIdentifier",
"src": "2007:3:1"
},
{
"name": "i",
"nodeType": "YulIdentifier",
"src": "2012:1:1"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "2003:3:1"
},
"nodeType": "YulFunctionCall",
"src": "2003:11:1"
},
{
"arguments": [
{
"arguments": [
{
"name": "src",
"nodeType": "YulIdentifier",
"src": "2026:3:1"
},
{
"name": "i",
"nodeType": "YulIdentifier",
"src": "2031:1:1"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "2022:3:1"
},
"nodeType": "YulFunctionCall",
"src": "2022:11:1"
}
],
"functionName": {
"name": "mload",
"nodeType": "YulIdentifier",
"src": "2016:5:1"
},
"nodeType": "YulFunctionCall",
"src": "2016:18:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "1996:6:1"
},
"nodeType": "YulFunctionCall",
"src": "1996:39:1"
},
"nodeType": "YulExpressionStatement",
"src": "1996:39:1"
}
]
},
"condition": {
"arguments": [
{
"name": "i",
"nodeType": "YulIdentifier",
"src": "1943:1:1"
},
{
"name": "length",
"nodeType": "YulIdentifier",
"src": "1946:6:1"
}
],
"functionName": {
"name": "lt",
"nodeType": "YulIdentifier",
"src": "1940:2:1"
},
"nodeType": "YulFunctionCall",
"src": "1940:13:1"
},
"nodeType": "YulForLoop",
"post": {
"nodeType": "YulBlock",
"src": "1954:19:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "1956:15:1",
"value": {
"arguments": [
{
"name": "i",
"nodeType": "YulIdentifier",
"src": "1965:1:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1968:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "1961:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1961:10:1"
},
"variableNames": [
{
"name": "i",
"nodeType": "YulIdentifier",
"src": "1956:1:1"
}
]
}
]
},
"pre": {
"nodeType": "YulBlock",
"src": "1936:3:1",
"statements": []
},
"src": "1932:113:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "2079:76:1",
"statements": [
{
"expression": {
"arguments": [
{
"arguments": [
{
"name": "dst",
"nodeType": "YulIdentifier",
"src": "2129:3:1"
},
{
"name": "length",
"nodeType": "YulIdentifier",
"src": "2134:6:1"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "2125:3:1"
},
"nodeType": "YulFunctionCall",
"src": "2125:16:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2143:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "2118:6:1"
},
"nodeType": "YulFunctionCall",
"src": "2118:27:1"
},
"nodeType": "YulExpressionStatement",
"src": "2118:27:1"
}
]
},
"condition": {
"arguments": [
{
"name": "i",
"nodeType": "YulIdentifier",
"src": "2060:1:1"
},
{
"name": "length",
"nodeType": "YulIdentifier",
"src": "2063:6:1"
}
],
"functionName": {
"name": "gt",
"nodeType": "YulIdentifier",
"src": "2057:2:1"
},
"nodeType": "YulFunctionCall",
"src": "2057:13:1"
},
"nodeType": "YulIf",
"src": "2054:101:1"
}
]
},
"name": "copy_memory_to_memory",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "src",
"nodeType": "YulTypedName",
"src": "1885:3:1",
"type": ""
},
{
"name": "dst",
"nodeType": "YulTypedName",
"src": "1890:3:1",
"type": ""
},
{
"name": "length",
"nodeType": "YulTypedName",
"src": "1895:6:1",
"type": ""
}
],
"src": "1854:307:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "2218:269:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "2228:22:1",
"value": {
"arguments": [
{
"name": "data",
"nodeType": "YulIdentifier",
"src": "2242:4:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2248:1:1",
"type": "",
"value": "2"
}
],
"functionName": {
"name": "div",
"nodeType": "YulIdentifier",
"src": "2238:3:1"
},
"nodeType": "YulFunctionCall",
"src": "2238:12:1"
},
"variableNames": [
{
"name": "length",
"nodeType": "YulIdentifier",
"src": "2228:6:1"
}
]
},
{
"nodeType": "YulVariableDeclaration",
"src": "2259:38:1",
"value": {
"arguments": [
{
"name": "data",
"nodeType": "YulIdentifier",
"src": "2289:4:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2295:1:1",
"type": "",
"value": "1"
}
],
"functionName": {
"name": "and",
"nodeType": "YulIdentifier",
"src": "2285:3:1"
},
"nodeType": "YulFunctionCall",
"src": "2285:12:1"
},
"variables": [
{
"name": "outOfPlaceEncoding",
"nodeType": "YulTypedName",
"src": "2263:18:1",
"type": ""
}
]
},
{
"body": {
"nodeType": "YulBlock",
"src": "2336:51:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "2350:27:1",
"value": {
"arguments": [
{
"name": "length",
"nodeType": "YulIdentifier",
"src": "2364:6:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2372:4:1",
"type": "",
"value": "0x7f"
}
],
"functionName": {
"name": "and",
"nodeType": "YulIdentifier",
"src": "2360:3:1"
},
"nodeType": "YulFunctionCall",
"src": "2360:17:1"
},
"variableNames": [
{
"name": "length",
"nodeType": "YulIdentifier",
"src": "2350:6:1"
}
]
}
]
},
"condition": {
"arguments": [
{
"name": "outOfPlaceEncoding",
"nodeType": "YulIdentifier",
"src": "2316:18:1"
}
],
"functionName": {
"name": "iszero",
"nodeType": "YulIdentifier",
"src": "2309:6:1"
},
"nodeType": "YulFunctionCall",
"src": "2309:26:1"
},
"nodeType": "YulIf",
"src": "2306:81:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "2439:42:1",
"statements": [
{
"expression": {
"arguments": [],
"functionName": {
"name": "panic_error_0x22",
"nodeType": "YulIdentifier",
"src": "2453:16:1"
},
"nodeType": "YulFunctionCall",
"src": "2453:18:1"
},
"nodeType": "YulExpressionStatement",
"src": "2453:18:1"
}
]
},
"condition": {
"arguments": [
{
"name": "outOfPlaceEncoding",
"nodeType": "YulIdentifier",
"src": "2403:18:1"
},
{
"arguments": [
{
"name": "length",
"nodeType": "YulIdentifier",
"src": "2426:6:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2434:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "lt",
"nodeType": "YulIdentifier",
"src": "2423:2:1"
},
"nodeType": "YulFunctionCall",
"src": "2423:14:1"
}
],
"functionName": {
"name": "eq",
"nodeType": "YulIdentifier",
"src": "2400:2:1"
},
"nodeType": "YulFunctionCall",
"src": "2400:38:1"
},
"nodeType": "YulIf",
"src": "2397:84:1"
}
]
},
"name": "extract_byte_array_length",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "data",
"nodeType": "YulTypedName",
"src": "2202:4:1",
"type": ""
}
],
"returnVariables": [
{
"name": "length",
"nodeType": "YulTypedName",
"src": "2211:6:1",
"type": ""
}
],
"src": "2167:320:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "2521:152:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2538:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2541:77:1",
"type": "",
"value": "35408467139433450592217433187231851964531694900788300625387963629091585785856"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "2531:6:1"
},
"nodeType": "YulFunctionCall",
"src": "2531:88:1"
},
"nodeType": "YulExpressionStatement",
"src": "2531:88:1"
},
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2635:1:1",
"type": "",
"value": "4"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2638:4:1",
"type": "",
"value": "0x22"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "2628:6:1"
},
"nodeType": "YulFunctionCall",
"src": "2628:15:1"
},
"nodeType": "YulExpressionStatement",
"src": "2628:15:1"
},
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2659:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2662:4:1",
"type": "",
"value": "0x24"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "2652:6:1"
},
"nodeType": "YulFunctionCall",
"src": "2652:15:1"
},
"nodeType": "YulExpressionStatement",
"src": "2652:15:1"
}
]
},
"name": "panic_error_0x22",
"nodeType": "YulFunctionDefinition",
"src": "2493:180:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "2768:28:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2785:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2788:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "2778:6:1"
},
"nodeType": "YulFunctionCall",
"src": "2778:12:1"
},
"nodeType": "YulExpressionStatement",
"src": "2778:12:1"
}
]
},
"name": "revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db",
"nodeType": "YulFunctionDefinition",
"src": "2679:117:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "2891:28:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2908:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2911:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "2901:6:1"
},
"nodeType": "YulFunctionCall",
"src": "2901:12:1"
},
"nodeType": "YulExpressionStatement",
"src": "2901:12:1"
}
]
},
"name": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b",
"nodeType": "YulFunctionDefinition",
"src": "2802:117:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "2973:54:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "2983:38:1",
"value": {
"arguments": [
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "3001:5:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "3008:2:1",
"type": "",
"value": "31"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "2997:3:1"
},
"nodeType": "YulFunctionCall",
"src": "2997:14:1"
},
{
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "3017:2:1",
"type": "",
"value": "31"
}
],
"functionName": {
"name": "not",
"nodeType": "YulIdentifier",
"src": "3013:3:1"
},
"nodeType": "YulFunctionCall",
"src": "3013:7:1"
}
],
"functionName": {
"name": "and",
"nodeType": "YulIdentifier",
"src": "2993:3:1"
},
"nodeType": "YulFunctionCall",
"src": "2993:28:1"
},
"variableNames": [
{
"name": "result",
"nodeType": "YulIdentifier",
"src": "2983:6:1"
}
]
}
]
},
"name": "round_up_to_mul_of_32",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "2956:5:1",
"type": ""
}
],
"returnVariables": [
{
"name": "result",
"nodeType": "YulTypedName",
"src": "2966:6:1",
"type": ""
}
],
"src": "2925:102:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "3076:79:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "3133:16:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "3142:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "3145:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "3135:6:1"
},
"nodeType": "YulFunctionCall",
"src": "3135:12:1"
},
"nodeType": "YulExpressionStatement",
"src": "3135:12:1"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "3099:5:1"
},
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "3124:5:1"
}
],
"functionName": {
"name": "cleanup_t_uint256",
"nodeType": "YulIdentifier",
"src": "3106:17:1"
},
"nodeType": "YulFunctionCall",
"src": "3106:24:1"
}
],
"functionName": {
"name": "eq",
"nodeType": "YulIdentifier",
"src": "3096:2:1"
},
"nodeType": "YulFunctionCall",
"src": "3096:35:1"
}
],
"functionName": {
"name": "iszero",
"nodeType": "YulIdentifier",
"src": "3089:6:1"
},
"nodeType": "YulFunctionCall",
"src": "3089:43:1"
},
"nodeType": "YulIf",
"src": "3086:63:1"
}
]
},
"name": "validator_revert_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "3069:5:1",
"type": ""
}
],
"src": "3033:122:1"
}
]
},
"contents": "{\n\n function abi_decode_t_uint256(offset, end) -> value {\n value := calldataload(offset)\n validator_revert_t_uint256(value)\n }\n\n function abi_decode_tuple_t_uint256(headStart, dataEnd) -> value0 {\n if slt(sub(dataEnd, headStart), 32) { revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() }\n\n {\n\n let offset := 0\n\n value0 := abi_decode_t_uint256(add(headStart, offset), dataEnd)\n }\n\n }\n\n function abi_encode_t_string_memory_ptr_to_t_string_memory_ptr_fromStack(value, pos) -> end {\n let length := array_length_t_string_memory_ptr(value)\n pos := array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, length)\n copy_memory_to_memory(add(value, 0x20), pos, length)\n end := add(pos, round_up_to_mul_of_32(length))\n }\n\n function abi_encode_t_uint256_to_t_uint256_fromStack(value, pos) {\n mstore(pos, cleanup_t_uint256(value))\n }\n\n function abi_encode_tuple_t_string_memory_ptr_t_uint256__to_t_string_memory_ptr_t_uint256__fromStack_reversed(headStart , value1, value0) -> tail {\n tail := add(headStart, 64)\n\n mstore(add(headStart, 0), sub(tail, headStart))\n tail := abi_encode_t_string_memory_ptr_to_t_string_memory_ptr_fromStack(value0, tail)\n\n abi_encode_t_uint256_to_t_uint256_fromStack(value1, add(headStart, 32))\n\n }\n\n function allocate_unbounded() -> memPtr {\n memPtr := mload(64)\n }\n\n function array_length_t_string_memory_ptr(value) -> length {\n\n length := mload(value)\n\n }\n\n function array_storeLengthForEncoding_t_string_memory_ptr_fromStack(pos, length) -> updated_pos {\n mstore(pos, length)\n updated_pos := add(pos, 0x20)\n }\n\n function cleanup_t_uint256(value) -> cleaned {\n cleaned := value\n }\n\n function copy_memory_to_memory(src, dst, length) {\n let i := 0\n for { } lt(i, length) { i := add(i, 32) }\n {\n mstore(add(dst, i), mload(add(src, i)))\n }\n if gt(i, length)\n {\n // clear end\n mstore(add(dst, length), 0)\n }\n }\n\n function extract_byte_array_length(data) -> length {\n length := div(data, 2)\n let outOfPlaceEncoding := and(data, 1)\n if iszero(outOfPlaceEncoding) {\n length := and(length, 0x7f)\n }\n\n if eq(outOfPlaceEncoding, lt(length, 32)) {\n panic_error_0x22()\n }\n }\n\n function panic_error_0x22() {\n mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)\n mstore(4, 0x22)\n revert(0, 0x24)\n }\n\n function revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db() {\n revert(0, 0)\n }\n\n function revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() {\n revert(0, 0)\n }\n\n function round_up_to_mul_of_32(value) -> result {\n result := and(add(value, 31), not(31))\n }\n\n function validator_revert_t_uint256(value) {\n if iszero(eq(value, cleanup_t_uint256(value))) { revert(0, 0) }\n }\n\n}\n",
"id": 1,
"language": "Yul",
"name": "#utility.yul"
}
],
"immutableReferences": {},
"linkReferences": {},
"object": "608060405234801561001057600080fd5b506004361061002b5760003560e01c806369ddcade14610030575b600080fd5b61004a60048036038101906100459190610132565b610061565b6040516100589291906101a7565b60405180910390f35b6000818154811061007157600080fd5b906000526020600020906002020160009150905080600001805461009490610230565b80601f01602080910402602001604051908101604052809291908181526020018280546100c090610230565b801561010d5780601f106100e25761010080835404028352916020019161010d565b820191906000526020600020905b8154815290600101906020018083116100f057829003601f168201915b5050505050908060010154905082565b60008135905061012c816102a7565b92915050565b60006020828403121561014857610147610291565b5b60006101568482850161011d565b91505092915050565b600061016a826101d7565b61017481856101e2565b93506101848185602086016101fd565b61018d81610296565b840191505092915050565b6101a1816101f3565b82525050565b600060408201905081810360008301526101c1818561015f565b90506101d06020830184610198565b9392505050565b600081519050919050565b600082825260208201905092915050565b6000819050919050565b60005b8381101561021b578082015181840152602081019050610200565b8381111561022a576000848401525b50505050565b6000600282049050600182168061024857607f821691505b6020821081141561025c5761025b610262565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600080fd5b6000601f19601f8301169050919050565b6102b0816101f3565b81146102bb57600080fd5b5056fea26469706673582212202dd0fc778d71b1571f62fabc146b35b02b95aa18b6b4932392871dcaeffd4bc064736f6c63430008070033",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x2B JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x69DDCADE EQ PUSH2 0x30 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4A PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x45 SWAP2 SWAP1 PUSH2 0x132 JUMP JUMPDEST PUSH2 0x61 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x58 SWAP3 SWAP2 SWAP1 PUSH2 0x1A7 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x0 DUP2 DUP2 SLOAD DUP2 LT PUSH2 0x71 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 PUSH1 0x2 MUL ADD PUSH1 0x0 SWAP2 POP SWAP1 POP DUP1 PUSH1 0x0 ADD DUP1 SLOAD PUSH2 0x94 SWAP1 PUSH2 0x230 JUMP JUMPDEST DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP3 DUP1 SLOAD PUSH2 0xC0 SWAP1 PUSH2 0x230 JUMP JUMPDEST DUP1 ISZERO PUSH2 0x10D JUMPI DUP1 PUSH1 0x1F LT PUSH2 0xE2 JUMPI PUSH2 0x100 DUP1 DUP4 SLOAD DIV MUL DUP4 MSTORE SWAP2 PUSH1 0x20 ADD SWAP2 PUSH2 0x10D JUMP JUMPDEST DUP3 ADD SWAP2 SWAP1 PUSH1 0x0 MSTORE PUSH1 0x20 PUSH1 0x0 KECCAK256 SWAP1 JUMPDEST DUP2 SLOAD DUP2 MSTORE SWAP1 PUSH1 0x1 ADD SWAP1 PUSH1 0x20 ADD DUP1 DUP4 GT PUSH2 0xF0 JUMPI DUP3 SWAP1 SUB PUSH1 0x1F AND DUP3 ADD SWAP2 JUMPDEST POP POP POP POP POP SWAP1 DUP1 PUSH1 0x1 ADD SLOAD SWAP1 POP DUP3 JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0x12C DUP2 PUSH2 0x2A7 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x148 JUMPI PUSH2 0x147 PUSH2 0x291 JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH2 0x156 DUP5 DUP3 DUP6 ADD PUSH2 0x11D JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x16A DUP3 PUSH2 0x1D7 JUMP JUMPDEST PUSH2 0x174 DUP2 DUP6 PUSH2 0x1E2 JUMP JUMPDEST SWAP4 POP PUSH2 0x184 DUP2 DUP6 PUSH1 0x20 DUP7 ADD PUSH2 0x1FD JUMP JUMPDEST PUSH2 0x18D DUP2 PUSH2 0x296 JUMP JUMPDEST DUP5 ADD SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0x1A1 DUP2 PUSH2 0x1F3 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x40 DUP3 ADD SWAP1 POP DUP2 DUP2 SUB PUSH1 0x0 DUP4 ADD MSTORE PUSH2 0x1C1 DUP2 DUP6 PUSH2 0x15F JUMP JUMPDEST SWAP1 POP PUSH2 0x1D0 PUSH1 0x20 DUP4 ADD DUP5 PUSH2 0x198 JUMP JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 MLOAD SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP3 DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP1 POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x21B JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x200 JUMP JUMPDEST DUP4 DUP2 GT ISZERO PUSH2 0x22A JUMPI PUSH1 0x0 DUP5 DUP5 ADD MSTORE JUMPDEST POP POP POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x2 DUP3 DIV SWAP1 POP PUSH1 0x1 DUP3 AND DUP1 PUSH2 0x248 JUMPI PUSH1 0x7F DUP3 AND SWAP2 POP JUMPDEST PUSH1 0x20 DUP3 LT DUP2 EQ ISZERO PUSH2 0x25C JUMPI PUSH2 0x25B PUSH2 0x262 JUMP JUMPDEST JUMPDEST POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x22 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x1F NOT PUSH1 0x1F DUP4 ADD AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH2 0x2B0 DUP2 PUSH2 0x1F3 JUMP JUMPDEST DUP2 EQ PUSH2 0x2BB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0x2D 0xD0 0xFC PUSH24 0x8D71B1571F62FABC146B35B02B95AA18B6B4932392871DCA 0xEF REVERT 0x4B 0xC0 PUSH5 0x736F6C6343 STOP ADDMOD SMOD STOP CALLER ",
"sourceMap": "68:211:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;162:23;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;7:139:1:-;53:5;91:6;78:20;69:29;;107:33;134:5;107:33;:::i;:::-;7:139;;;;:::o;152:329::-;211:6;260:2;248:9;239:7;235:23;231:32;228:119;;;266:79;;:::i;:::-;228:119;386:1;411:53;456:7;447:6;436:9;432:22;411:53;:::i;:::-;401:63;;357:117;152:329;;;;:::o;487:364::-;575:3;603:39;636:5;603:39;:::i;:::-;658:71;722:6;717:3;658:71;:::i;:::-;651:78;;738:52;783:6;778:3;771:4;764:5;760:16;738:52;:::i;:::-;815:29;837:6;815:29;:::i;:::-;810:3;806:39;799:46;;579:272;487:364;;;;:::o;857:118::-;944:24;962:5;944:24;:::i;:::-;939:3;932:37;857:118;;:::o;981:423::-;1122:4;1160:2;1149:9;1145:18;1137:26;;1209:9;1203:4;1199:20;1195:1;1184:9;1180:17;1173:47;1237:78;1310:4;1301:6;1237:78;:::i;:::-;1229:86;;1325:72;1393:2;1382:9;1378:18;1369:6;1325:72;:::i;:::-;981:423;;;;;:::o;1491:99::-;1543:6;1577:5;1571:12;1561:22;;1491:99;;;:::o;1596:169::-;1680:11;1714:6;1709:3;1702:19;1754:4;1749:3;1745:14;1730:29;;1596:169;;;;:::o;1771:77::-;1808:7;1837:5;1826:16;;1771:77;;;:::o;1854:307::-;1922:1;1932:113;1946:6;1943:1;1940:13;1932:113;;;2031:1;2026:3;2022:11;2016:18;2012:1;2007:3;2003:11;1996:39;1968:2;1965:1;1961:10;1956:15;;1932:113;;;2063:6;2060:1;2057:13;2054:101;;;2143:1;2134:6;2129:3;2125:16;2118:27;2054:101;1903:258;1854:307;;;:::o;2167:320::-;2211:6;2248:1;2242:4;2238:12;2228:22;;2295:1;2289:4;2285:12;2316:18;2306:81;;2372:4;2364:6;2360:17;2350:27;;2306:81;2434:2;2426:6;2423:14;2403:18;2400:38;2397:84;;;2453:18;;:::i;:::-;2397:84;2218:269;2167:320;;;:::o;2493:180::-;2541:77;2538:1;2531:88;2638:4;2635:1;2628:15;2662:4;2659:1;2652:15;2802:117;2911:1;2908;2901:12;2925:102;2966:6;3017:2;3013:7;3008:2;3001:5;2997:14;2993:28;2983:38;;2925:102;;;:::o;3033:122::-;3106:24;3124:5;3106:24;:::i;:::-;3099:5;3096:35;3086:63;;3145:1;3142;3135:12;3086:63;3033:122;:::o"
},
"gasEstimates": {
"creation": {
"codeDepositCost": "151200",
"executionCost": "infinite",
"totalCost": "infinite"
},
"external": {
"alumnos(uint256)": "infinite"
}
},
"methodIdentifiers": {
"alumnos(uint256)": "69ddcade"
}
},
"abi": [
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "alumnos",
"outputs": [
{
"internalType": "string",
"name": "nombre",
"type": "string"
},
{
"internalType": "uint256",
"name": "documento",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
]
}
{
"compiler": {
"version": "0.8.7+commit.e28d00a7"
},
"language": "Solidity",
"output": {
"abi": [
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "alumnos",
"outputs": [
{
"internalType": "string",
"name": "nombre",
"type": "string"
},
{
"internalType": "uint256",
"name": "documento",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
],
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"settings": {
"compilationTarget": {
"contracts/DatosStructurados.sol": "Clase"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
},
"sources": {
"contracts/DatosStructurados.sol": {
"keccak256": "0xf56f89c509b25bb3de47d79e2b0e3b286a94e5a68967d6ed15ee3b0d988e029e",
"license": "GPL-3.0",
"urls": [
"bzz-raw://2003309ad23f1632f2a8cf3135f989a65a164d7454b430751baa2472aa3ee381",
"dweb:/ipfs/QmU1tdWsqzDhjppLU9z79m9Tf6Bt8eHfsgav6Laq5xchMq"
]
}
},
"version": 1
}
{
"deploy": {
"VM:-": {
"linkReferences": {},
"autoDeployLib": true
},
"main:1": {
"linkReferences": {},
"autoDeployLib": true
},
"ropsten:3": {
"linkReferences": {},
"autoDeployLib": true
},
"rinkeby:4": {
"linkReferences": {},
"autoDeployLib": true
},
"kovan:42": {
"linkReferences": {},
"autoDeployLib": true
},
"görli:5": {
"linkReferences": {},
"autoDeployLib": true
},
"Custom": {
"linkReferences": {},
"autoDeployLib": true
}
},
"data": {
"bytecode": {
"functionDebugData": {
"@_32": {
"entryPoint": null,
"id": 32,
"parameterSlots": 0,
"returnSlots": 0
},
"panic_error_0x21": {
"entryPoint": 176,
"id": null,
"parameterSlots": 0,
"returnSlots": 0
}
},
"generatedSources": [
{
"ast": {
"nodeType": "YulBlock",
"src": "0:190:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "35:152:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "52:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "55:77:1",
"type": "",
"value": "35408467139433450592217433187231851964531694900788300625387963629091585785856"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "45:6:1"
},
"nodeType": "YulFunctionCall",
"src": "45:88:1"
},
"nodeType": "YulExpressionStatement",
"src": "45:88:1"
},
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "149:1:1",
"type": "",
"value": "4"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "152:4:1",
"type": "",
"value": "0x21"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "142:6:1"
},
"nodeType": "YulFunctionCall",
"src": "142:15:1"
},
"nodeType": "YulExpressionStatement",
"src": "142:15:1"
},
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "173:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "176:4:1",
"type": "",
"value": "0x24"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "166:6:1"
},
"nodeType": "YulFunctionCall",
"src": "166:15:1"
},
"nodeType": "YulExpressionStatement",
"src": "166:15:1"
}
]
},
"name": "panic_error_0x21",
"nodeType": "YulFunctionDefinition",
"src": "7:180:1"
}
]
},
"contents": "{\n\n function panic_error_0x21() {\n mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)\n mstore(4, 0x21)\n revert(0, 0x24)\n }\n\n}\n",
"id": 1,
"language": "Yul",
"name": "#utility.yul"
}
],
"linkReferences": {},
"object": "608060405234801561001057600080fd5b506000600160006101000a81548160ff02191690836001811115610037576100366100b0565b5b02179055506103e86000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060018060006101000a81548160ff021916908360018111156100a6576100a56100b0565b5b02179055506100df565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b610240806100ee6000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80630594cc691461003b578063e3d670d714610059575b600080fd5b610043610089565b6040516100509190610114565b60405180910390f35b610073600480360381019061006e91906100c9565b61009c565b604051610080919061012f565b60405180910390f35b600160009054906101000a900460ff1681565b60006020528060005260406000206000915090505481565b6000813590506100c3816101f3565b92915050565b6000602082840312156100df576100de6101da565b5b60006100ed848285016100b4565b91505092915050565b6100ff81610199565b82525050565b61010e8161018f565b82525050565b600060208201905061012960008301846100f6565b92915050565b60006020820190506101446000830184610105565b92915050565b60006101558261016f565b9050919050565b600081905061016a826101df565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006101a48261015c565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600080fd5b600281106101f0576101ef6101ab565b5b50565b6101fc8161014a565b811461020757600080fd5b5056fea26469706673582212205ee7d3f2978e9b862246e34295315e9d4465a9da3c5a4bbca6168df4a625e41b64736f6c63430008070033",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x0 PUSH1 0x1 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 PUSH1 0x1 DUP2 GT ISZERO PUSH2 0x37 JUMPI PUSH2 0x36 PUSH2 0xB0 JUMP JUMPDEST JUMPDEST MUL OR SWAP1 SSTORE POP PUSH2 0x3E8 PUSH1 0x0 DUP1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 DUP2 SWAP1 SSTORE POP PUSH1 0x1 DUP1 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 PUSH1 0x1 DUP2 GT ISZERO PUSH2 0xA6 JUMPI PUSH2 0xA5 PUSH2 0xB0 JUMP JUMPDEST JUMPDEST MUL OR SWAP1 SSTORE POP PUSH2 0xDF JUMP JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x21 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH2 0x240 DUP1 PUSH2 0xEE PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x36 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x594CC69 EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0xE3D670D7 EQ PUSH2 0x59 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x43 PUSH2 0x89 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x50 SWAP2 SWAP1 PUSH2 0x114 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x73 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x6E SWAP2 SWAP1 PUSH2 0xC9 JUMP JUMPDEST PUSH2 0x9C JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x80 SWAP2 SWAP1 PUSH2 0x12F JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SWAP1 POP SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0xC3 DUP2 PUSH2 0x1F3 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0xDF JUMPI PUSH2 0xDE PUSH2 0x1DA JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH2 0xED DUP5 DUP3 DUP6 ADD PUSH2 0xB4 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0xFF DUP2 PUSH2 0x199 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH2 0x10E DUP2 PUSH2 0x18F JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x129 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0xF6 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x144 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x105 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x155 DUP3 PUSH2 0x16F JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP PUSH2 0x16A DUP3 PUSH2 0x1DF JUMP JUMPDEST SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x1A4 DUP3 PUSH2 0x15C JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x21 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x2 DUP2 LT PUSH2 0x1F0 JUMPI PUSH2 0x1EF PUSH2 0x1AB JUMP JUMPDEST JUMPDEST POP JUMP JUMPDEST PUSH2 0x1FC DUP2 PUSH2 0x14A JUMP JUMPDEST DUP2 EQ PUSH2 0x207 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0x5E 0xE7 0xD3 CALLCODE SWAP8 DUP15 SWAP12 DUP7 0x22 CHAINID 0xE3 TIMESTAMP SWAP6 BALANCE 0x5E SWAP14 DIFFICULTY PUSH6 0xA9DA3C5A4BBC 0xA6 AND DUP14 DELEGATECALL 0xA6 0x25 0xE4 SHL PUSH5 0x736F6C6343 STOP ADDMOD SMOD STOP CALLER ",
"sourceMap": "68:324:0:-:0;;;239:151;;;;;;;;;;283:15;263:17;;:35;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;331:4;309:7;:19;317:10;309:19;;;;;;;;;;;;;;;:26;;;;366:17;346;;:37;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;68:324;;7:180:1;55:77;52:1;45:88;152:4;149:1;142:15;176:4;173:1;166:15;68:324:0;;;;;;;"
},
"deployedBytecode": {
"functionDebugData": {
"@balance_5": {
"entryPoint": 156,
"id": 5,
"parameterSlots": 0,
"returnSlots": 0
},
"@estadoDelContrato_11": {
"entryPoint": 137,
"id": 11,
"parameterSlots": 0,
"returnSlots": 0
},
"abi_decode_t_address": {
"entryPoint": 180,
"id": null,
"parameterSlots": 2,
"returnSlots": 1
},
"abi_decode_tuple_t_address": {
"entryPoint": 201,
"id": null,
"parameterSlots": 2,
"returnSlots": 1
},
"abi_encode_t_enum$_Estado_$8_to_t_uint8_fromStack": {
"entryPoint": 246,
"id": null,
"parameterSlots": 2,
"returnSlots": 0
},
"abi_encode_t_uint256_to_t_uint256_fromStack": {
"entryPoint": 261,
"id": null,
"parameterSlots": 2,
"returnSlots": 0
},
"abi_encode_tuple_t_enum$_Estado_$8__to_t_uint8__fromStack_reversed": {
"entryPoint": 276,
"id": null,
"parameterSlots": 2,
"returnSlots": 1
},
"abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed": {
"entryPoint": 303,
"id": null,
"parameterSlots": 2,
"returnSlots": 1
},
"allocate_unbounded": {
"entryPoint": null,
"id": null,
"parameterSlots": 0,
"returnSlots": 1
},
"cleanup_t_address": {
"entryPoint": 330,
"id": null,
"parameterSlots": 1,
"returnSlots": 1
},
"cleanup_t_enum$_Estado_$8": {
"entryPoint": 348,
"id": null,
"parameterSlots": 1,
"returnSlots": 1
},
"cleanup_t_uint160": {
"entryPoint": 367,
"id": null,
"parameterSlots": 1,
"returnSlots": 1
},
"cleanup_t_uint256": {
"entryPoint": 399,
"id": null,
"parameterSlots": 1,
"returnSlots": 1
},
"convert_t_enum$_Estado_$8_to_t_uint8": {
"entryPoint": 409,
"id": null,
"parameterSlots": 1,
"returnSlots": 1
},
"panic_error_0x21": {
"entryPoint": 427,
"id": null,
"parameterSlots": 0,
"returnSlots": 0
},
"revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db": {
"entryPoint": null,
"id": null,
"parameterSlots": 0,
"returnSlots": 0
},
"revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b": {
"entryPoint": 474,
"id": null,
"parameterSlots": 0,
"returnSlots": 0
},
"validator_assert_t_enum$_Estado_$8": {
"entryPoint": 479,
"id": null,
"parameterSlots": 1,
"returnSlots": 0
},
"validator_revert_t_address": {
"entryPoint": 499,
"id": null,
"parameterSlots": 1,
"returnSlots": 0
}
},
"generatedSources": [
{
"ast": {
"nodeType": "YulBlock",
"src": "0:2568:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "59:87:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "69:29:1",
"value": {
"arguments": [
{
"name": "offset",
"nodeType": "YulIdentifier",
"src": "91:6:1"
}
],
"functionName": {
"name": "calldataload",
"nodeType": "YulIdentifier",
"src": "78:12:1"
},
"nodeType": "YulFunctionCall",
"src": "78:20:1"
},
"variableNames": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "69:5:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "134:5:1"
}
],
"functionName": {
"name": "validator_revert_t_address",
"nodeType": "YulIdentifier",
"src": "107:26:1"
},
"nodeType": "YulFunctionCall",
"src": "107:33:1"
},
"nodeType": "YulExpressionStatement",
"src": "107:33:1"
}
]
},
"name": "abi_decode_t_address",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "offset",
"nodeType": "YulTypedName",
"src": "37:6:1",
"type": ""
},
{
"name": "end",
"nodeType": "YulTypedName",
"src": "45:3:1",
"type": ""
}
],
"returnVariables": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "53:5:1",
"type": ""
}
],
"src": "7:139:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "218:263:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "264:83:1",
"statements": [
{
"expression": {
"arguments": [],
"functionName": {
"name": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b",
"nodeType": "YulIdentifier",
"src": "266:77:1"
},
"nodeType": "YulFunctionCall",
"src": "266:79:1"
},
"nodeType": "YulExpressionStatement",
"src": "266:79:1"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "239:7:1"
},
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "248:9:1"
}
],
"functionName": {
"name": "sub",
"nodeType": "YulIdentifier",
"src": "235:3:1"
},
"nodeType": "YulFunctionCall",
"src": "235:23:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "260:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "slt",
"nodeType": "YulIdentifier",
"src": "231:3:1"
},
"nodeType": "YulFunctionCall",
"src": "231:32:1"
},
"nodeType": "YulIf",
"src": "228:119:1"
},
{
"nodeType": "YulBlock",
"src": "357:117:1",
"statements": [
{
"nodeType": "YulVariableDeclaration",
"src": "372:15:1",
"value": {
"kind": "number",
"nodeType": "YulLiteral",
"src": "386:1:1",
"type": "",
"value": "0"
},
"variables": [
{
"name": "offset",
"nodeType": "YulTypedName",
"src": "376:6:1",
"type": ""
}
]
},
{
"nodeType": "YulAssignment",
"src": "401:63:1",
"value": {
"arguments": [
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "436:9:1"
},
{
"name": "offset",
"nodeType": "YulIdentifier",
"src": "447:6:1"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "432:3:1"
},
"nodeType": "YulFunctionCall",
"src": "432:22:1"
},
{
"name": "dataEnd",
"nodeType": "YulIdentifier",
"src": "456:7:1"
}
],
"functionName": {
"name": "abi_decode_t_address",
"nodeType": "YulIdentifier",
"src": "411:20:1"
},
"nodeType": "YulFunctionCall",
"src": "411:53:1"
},
"variableNames": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "401:6:1"
}
]
}
]
}
]
},
"name": "abi_decode_tuple_t_address",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "188:9:1",
"type": ""
},
{
"name": "dataEnd",
"nodeType": "YulTypedName",
"src": "199:7:1",
"type": ""
}
],
"returnVariables": [
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "211:6:1",
"type": ""
}
],
"src": "152:329:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "558:72:1",
"statements": [
{
"expression": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "575:3:1"
},
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "617:5:1"
}
],
"functionName": {
"name": "convert_t_enum$_Estado_$8_to_t_uint8",
"nodeType": "YulIdentifier",
"src": "580:36:1"
},
"nodeType": "YulFunctionCall",
"src": "580:43:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "568:6:1"
},
"nodeType": "YulFunctionCall",
"src": "568:56:1"
},
"nodeType": "YulExpressionStatement",
"src": "568:56:1"
}
]
},
"name": "abi_encode_t_enum$_Estado_$8_to_t_uint8_fromStack",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "546:5:1",
"type": ""
},
{
"name": "pos",
"nodeType": "YulTypedName",
"src": "553:3:1",
"type": ""
}
],
"src": "487:143:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "701:53:1",
"statements": [
{
"expression": {
"arguments": [
{
"name": "pos",
"nodeType": "YulIdentifier",
"src": "718:3:1"
},
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "741:5:1"
}
],
"functionName": {
"name": "cleanup_t_uint256",
"nodeType": "YulIdentifier",
"src": "723:17:1"
},
"nodeType": "YulFunctionCall",
"src": "723:24:1"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "711:6:1"
},
"nodeType": "YulFunctionCall",
"src": "711:37:1"
},
"nodeType": "YulExpressionStatement",
"src": "711:37:1"
}
]
},
"name": "abi_encode_t_uint256_to_t_uint256_fromStack",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "689:5:1",
"type": ""
},
{
"name": "pos",
"nodeType": "YulTypedName",
"src": "696:3:1",
"type": ""
}
],
"src": "636:118:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "864:130:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "874:26:1",
"value": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "886:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "897:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "882:3:1"
},
"nodeType": "YulFunctionCall",
"src": "882:18:1"
},
"variableNames": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "874:4:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "960:6:1"
},
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "973:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "984:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "969:3:1"
},
"nodeType": "YulFunctionCall",
"src": "969:17:1"
}
],
"functionName": {
"name": "abi_encode_t_enum$_Estado_$8_to_t_uint8_fromStack",
"nodeType": "YulIdentifier",
"src": "910:49:1"
},
"nodeType": "YulFunctionCall",
"src": "910:77:1"
},
"nodeType": "YulExpressionStatement",
"src": "910:77:1"
}
]
},
"name": "abi_encode_tuple_t_enum$_Estado_$8__to_t_uint8__fromStack_reversed",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "836:9:1",
"type": ""
},
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "848:6:1",
"type": ""
}
],
"returnVariables": [
{
"name": "tail",
"nodeType": "YulTypedName",
"src": "859:4:1",
"type": ""
}
],
"src": "760:234:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1098:124:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "1108:26:1",
"value": {
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "1120:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1131:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "1116:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1116:18:1"
},
"variableNames": [
{
"name": "tail",
"nodeType": "YulIdentifier",
"src": "1108:4:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "value0",
"nodeType": "YulIdentifier",
"src": "1188:6:1"
},
{
"arguments": [
{
"name": "headStart",
"nodeType": "YulIdentifier",
"src": "1201:9:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1212:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "1197:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1197:17:1"
}
],
"functionName": {
"name": "abi_encode_t_uint256_to_t_uint256_fromStack",
"nodeType": "YulIdentifier",
"src": "1144:43:1"
},
"nodeType": "YulFunctionCall",
"src": "1144:71:1"
},
"nodeType": "YulExpressionStatement",
"src": "1144:71:1"
}
]
},
"name": "abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "headStart",
"nodeType": "YulTypedName",
"src": "1070:9:1",
"type": ""
},
{
"name": "value0",
"nodeType": "YulTypedName",
"src": "1082:6:1",
"type": ""
}
],
"returnVariables": [
{
"name": "tail",
"nodeType": "YulTypedName",
"src": "1093:4:1",
"type": ""
}
],
"src": "1000:222:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1268:35:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "1278:19:1",
"value": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1294:2:1",
"type": "",
"value": "64"
}
],
"functionName": {
"name": "mload",
"nodeType": "YulIdentifier",
"src": "1288:5:1"
},
"nodeType": "YulFunctionCall",
"src": "1288:9:1"
},
"variableNames": [
{
"name": "memPtr",
"nodeType": "YulIdentifier",
"src": "1278:6:1"
}
]
}
]
},
"name": "allocate_unbounded",
"nodeType": "YulFunctionDefinition",
"returnVariables": [
{
"name": "memPtr",
"nodeType": "YulTypedName",
"src": "1261:6:1",
"type": ""
}
],
"src": "1228:75:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1354:51:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "1364:35:1",
"value": {
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "1393:5:1"
}
],
"functionName": {
"name": "cleanup_t_uint160",
"nodeType": "YulIdentifier",
"src": "1375:17:1"
},
"nodeType": "YulFunctionCall",
"src": "1375:24:1"
},
"variableNames": [
{
"name": "cleaned",
"nodeType": "YulIdentifier",
"src": "1364:7:1"
}
]
}
]
},
"name": "cleanup_t_address",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "1336:5:1",
"type": ""
}
],
"returnVariables": [
{
"name": "cleaned",
"nodeType": "YulTypedName",
"src": "1346:7:1",
"type": ""
}
],
"src": "1309:96:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1464:74:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "1474:16:1",
"value": {
"name": "value",
"nodeType": "YulIdentifier",
"src": "1485:5:1"
},
"variableNames": [
{
"name": "cleaned",
"nodeType": "YulIdentifier",
"src": "1474:7:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "1526:5:1"
}
],
"functionName": {
"name": "validator_assert_t_enum$_Estado_$8",
"nodeType": "YulIdentifier",
"src": "1491:34:1"
},
"nodeType": "YulFunctionCall",
"src": "1491:41:1"
},
"nodeType": "YulExpressionStatement",
"src": "1491:41:1"
}
]
},
"name": "cleanup_t_enum$_Estado_$8",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "1446:5:1",
"type": ""
}
],
"returnVariables": [
{
"name": "cleaned",
"nodeType": "YulTypedName",
"src": "1456:7:1",
"type": ""
}
],
"src": "1411:127:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1589:81:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "1599:65:1",
"value": {
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "1614:5:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1621:42:1",
"type": "",
"value": "0xffffffffffffffffffffffffffffffffffffffff"
}
],
"functionName": {
"name": "and",
"nodeType": "YulIdentifier",
"src": "1610:3:1"
},
"nodeType": "YulFunctionCall",
"src": "1610:54:1"
},
"variableNames": [
{
"name": "cleaned",
"nodeType": "YulIdentifier",
"src": "1599:7:1"
}
]
}
]
},
"name": "cleanup_t_uint160",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "1571:5:1",
"type": ""
}
],
"returnVariables": [
{
"name": "cleaned",
"nodeType": "YulTypedName",
"src": "1581:7:1",
"type": ""
}
],
"src": "1544:126:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1721:32:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "1731:16:1",
"value": {
"name": "value",
"nodeType": "YulIdentifier",
"src": "1742:5:1"
},
"variableNames": [
{
"name": "cleaned",
"nodeType": "YulIdentifier",
"src": "1731:7:1"
}
]
}
]
},
"name": "cleanup_t_uint256",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "1703:5:1",
"type": ""
}
],
"returnVariables": [
{
"name": "cleaned",
"nodeType": "YulTypedName",
"src": "1713:7:1",
"type": ""
}
],
"src": "1676:77:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1825:61:1",
"statements": [
{
"nodeType": "YulAssignment",
"src": "1835:45:1",
"value": {
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "1874:5:1"
}
],
"functionName": {
"name": "cleanup_t_enum$_Estado_$8",
"nodeType": "YulIdentifier",
"src": "1848:25:1"
},
"nodeType": "YulFunctionCall",
"src": "1848:32:1"
},
"variableNames": [
{
"name": "converted",
"nodeType": "YulIdentifier",
"src": "1835:9:1"
}
]
}
]
},
"name": "convert_t_enum$_Estado_$8_to_t_uint8",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "1805:5:1",
"type": ""
}
],
"returnVariables": [
{
"name": "converted",
"nodeType": "YulTypedName",
"src": "1815:9:1",
"type": ""
}
],
"src": "1759:127:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "1920:152:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1937:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "1940:77:1",
"type": "",
"value": "35408467139433450592217433187231851964531694900788300625387963629091585785856"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "1930:6:1"
},
"nodeType": "YulFunctionCall",
"src": "1930:88:1"
},
"nodeType": "YulExpressionStatement",
"src": "1930:88:1"
},
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2034:1:1",
"type": "",
"value": "4"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2037:4:1",
"type": "",
"value": "0x21"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "2027:6:1"
},
"nodeType": "YulFunctionCall",
"src": "2027:15:1"
},
"nodeType": "YulExpressionStatement",
"src": "2027:15:1"
},
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2058:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2061:4:1",
"type": "",
"value": "0x24"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "2051:6:1"
},
"nodeType": "YulFunctionCall",
"src": "2051:15:1"
},
"nodeType": "YulExpressionStatement",
"src": "2051:15:1"
}
]
},
"name": "panic_error_0x21",
"nodeType": "YulFunctionDefinition",
"src": "1892:180:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "2167:28:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2184:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2187:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "2177:6:1"
},
"nodeType": "YulFunctionCall",
"src": "2177:12:1"
},
"nodeType": "YulExpressionStatement",
"src": "2177:12:1"
}
]
},
"name": "revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db",
"nodeType": "YulFunctionDefinition",
"src": "2078:117:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "2290:28:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2307:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2310:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "2300:6:1"
},
"nodeType": "YulFunctionCall",
"src": "2300:12:1"
},
"nodeType": "YulExpressionStatement",
"src": "2300:12:1"
}
]
},
"name": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b",
"nodeType": "YulFunctionDefinition",
"src": "2201:117:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "2375:62:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "2409:22:1",
"statements": [
{
"expression": {
"arguments": [],
"functionName": {
"name": "panic_error_0x21",
"nodeType": "YulIdentifier",
"src": "2411:16:1"
},
"nodeType": "YulFunctionCall",
"src": "2411:18:1"
},
"nodeType": "YulExpressionStatement",
"src": "2411:18:1"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "2398:5:1"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2405:1:1",
"type": "",
"value": "2"
}
],
"functionName": {
"name": "lt",
"nodeType": "YulIdentifier",
"src": "2395:2:1"
},
"nodeType": "YulFunctionCall",
"src": "2395:12:1"
}
],
"functionName": {
"name": "iszero",
"nodeType": "YulIdentifier",
"src": "2388:6:1"
},
"nodeType": "YulFunctionCall",
"src": "2388:20:1"
},
"nodeType": "YulIf",
"src": "2385:46:1"
}
]
},
"name": "validator_assert_t_enum$_Estado_$8",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "2368:5:1",
"type": ""
}
],
"src": "2324:113:1"
},
{
"body": {
"nodeType": "YulBlock",
"src": "2486:79:1",
"statements": [
{
"body": {
"nodeType": "YulBlock",
"src": "2543:16:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2552:1:1",
"type": "",
"value": "0"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "2555:1:1",
"type": "",
"value": "0"
}
],
"functionName": {
"name": "revert",
"nodeType": "YulIdentifier",
"src": "2545:6:1"
},
"nodeType": "YulFunctionCall",
"src": "2545:12:1"
},
"nodeType": "YulExpressionStatement",
"src": "2545:12:1"
}
]
},
"condition": {
"arguments": [
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "2509:5:1"
},
{
"arguments": [
{
"name": "value",
"nodeType": "YulIdentifier",
"src": "2534:5:1"
}
],
"functionName": {
"name": "cleanup_t_address",
"nodeType": "YulIdentifier",
"src": "2516:17:1"
},
"nodeType": "YulFunctionCall",
"src": "2516:24:1"
}
],
"functionName": {
"name": "eq",
"nodeType": "YulIdentifier",
"src": "2506:2:1"
},
"nodeType": "YulFunctionCall",
"src": "2506:35:1"
}
],
"functionName": {
"name": "iszero",
"nodeType": "YulIdentifier",
"src": "2499:6:1"
},
"nodeType": "YulFunctionCall",
"src": "2499:43:1"
},
"nodeType": "YulIf",
"src": "2496:63:1"
}
]
},
"name": "validator_revert_t_address",
"nodeType": "YulFunctionDefinition",
"parameters": [
{
"name": "value",
"nodeType": "YulTypedName",
"src": "2479:5:1",
"type": ""
}
],
"src": "2443:122:1"
}
]
},
"contents": "{\n\n function abi_decode_t_address(offset, end) -> value {\n value := calldataload(offset)\n validator_revert_t_address(value)\n }\n\n function abi_decode_tuple_t_address(headStart, dataEnd) -> value0 {\n if slt(sub(dataEnd, headStart), 32) { revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() }\n\n {\n\n let offset := 0\n\n value0 := abi_decode_t_address(add(headStart, offset), dataEnd)\n }\n\n }\n\n function abi_encode_t_enum$_Estado_$8_to_t_uint8_fromStack(value, pos) {\n mstore(pos, convert_t_enum$_Estado_$8_to_t_uint8(value))\n }\n\n function abi_encode_t_uint256_to_t_uint256_fromStack(value, pos) {\n mstore(pos, cleanup_t_uint256(value))\n }\n\n function abi_encode_tuple_t_enum$_Estado_$8__to_t_uint8__fromStack_reversed(headStart , value0) -> tail {\n tail := add(headStart, 32)\n\n abi_encode_t_enum$_Estado_$8_to_t_uint8_fromStack(value0, add(headStart, 0))\n\n }\n\n function abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed(headStart , value0) -> tail {\n tail := add(headStart, 32)\n\n abi_encode_t_uint256_to_t_uint256_fromStack(value0, add(headStart, 0))\n\n }\n\n function allocate_unbounded() -> memPtr {\n memPtr := mload(64)\n }\n\n function cleanup_t_address(value) -> cleaned {\n cleaned := cleanup_t_uint160(value)\n }\n\n function cleanup_t_enum$_Estado_$8(value) -> cleaned {\n cleaned := value validator_assert_t_enum$_Estado_$8(value)\n }\n\n function cleanup_t_uint160(value) -> cleaned {\n cleaned := and(value, 0xffffffffffffffffffffffffffffffffffffffff)\n }\n\n function cleanup_t_uint256(value) -> cleaned {\n cleaned := value\n }\n\n function convert_t_enum$_Estado_$8_to_t_uint8(value) -> converted {\n converted := cleanup_t_enum$_Estado_$8(value)\n }\n\n function panic_error_0x21() {\n mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)\n mstore(4, 0x21)\n revert(0, 0x24)\n }\n\n function revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db() {\n revert(0, 0)\n }\n\n function revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() {\n revert(0, 0)\n }\n\n function validator_assert_t_enum$_Estado_$8(value) {\n if iszero(lt(value, 2)) { panic_error_0x21() }\n }\n\n function validator_revert_t_address(value) {\n if iszero(eq(value, cleanup_t_address(value))) { revert(0, 0) }\n }\n\n}\n",
"id": 1,
"language": "Yul",
"name": "#utility.yul"
}
],
"immutableReferences": {},
"linkReferences": {},
"object": "608060405234801561001057600080fd5b50600436106100365760003560e01c80630594cc691461003b578063e3d670d714610059575b600080fd5b610043610089565b6040516100509190610114565b60405180910390f35b610073600480360381019061006e91906100c9565b61009c565b604051610080919061012f565b60405180910390f35b600160009054906101000a900460ff1681565b60006020528060005260406000206000915090505481565b6000813590506100c3816101f3565b92915050565b6000602082840312156100df576100de6101da565b5b60006100ed848285016100b4565b91505092915050565b6100ff81610199565b82525050565b61010e8161018f565b82525050565b600060208201905061012960008301846100f6565b92915050565b60006020820190506101446000830184610105565b92915050565b60006101558261016f565b9050919050565b600081905061016a826101df565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006101a48261015c565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600080fd5b600281106101f0576101ef6101ab565b5b50565b6101fc8161014a565b811461020757600080fd5b5056fea26469706673582212205ee7d3f2978e9b862246e34295315e9d4465a9da3c5a4bbca6168df4a625e41b64736f6c63430008070033",
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x36 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x594CC69 EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0xE3D670D7 EQ PUSH2 0x59 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x43 PUSH2 0x89 JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x50 SWAP2 SWAP1 PUSH2 0x114 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x73 PUSH1 0x4 DUP1 CALLDATASIZE SUB DUP2 ADD SWAP1 PUSH2 0x6E SWAP2 SWAP1 PUSH2 0xC9 JUMP JUMPDEST PUSH2 0x9C JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x80 SWAP2 SWAP1 PUSH2 0x12F JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SWAP1 POP SLOAD DUP2 JUMP JUMPDEST PUSH1 0x0 DUP2 CALLDATALOAD SWAP1 POP PUSH2 0xC3 DUP2 PUSH2 0x1F3 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0xDF JUMPI PUSH2 0xDE PUSH2 0x1DA JUMP JUMPDEST JUMPDEST PUSH1 0x0 PUSH2 0xED DUP5 DUP3 DUP6 ADD PUSH2 0xB4 JUMP JUMPDEST SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH2 0xFF DUP2 PUSH2 0x199 JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH2 0x10E DUP2 PUSH2 0x18F JUMP JUMPDEST DUP3 MSTORE POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x129 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0xF6 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 ADD SWAP1 POP PUSH2 0x144 PUSH1 0x0 DUP4 ADD DUP5 PUSH2 0x105 JUMP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x155 DUP3 PUSH2 0x16F JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP PUSH2 0x16A DUP3 PUSH2 0x1DF JUMP JUMPDEST SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF DUP3 AND SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 DUP2 SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x1A4 DUP3 PUSH2 0x15C JUMP JUMPDEST SWAP1 POP SWAP2 SWAP1 POP JUMP JUMPDEST PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH1 0x0 MSTORE PUSH1 0x21 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x2 DUP2 LT PUSH2 0x1F0 JUMPI PUSH2 0x1EF PUSH2 0x1AB JUMP JUMPDEST JUMPDEST POP JUMP JUMPDEST PUSH2 0x1FC DUP2 PUSH2 0x14A JUMP JUMPDEST DUP2 EQ PUSH2 0x207 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0x5E 0xE7 0xD3 CALLCODE SWAP8 DUP15 SWAP12 DUP7 0x22 CHAINID 0xE3 TIMESTAMP SWAP6 BALANCE 0x5E SWAP14 DIFFICULTY PUSH6 0xA9DA3C5A4BBC 0xA6 AND DUP14 DELEGATECALL 0xA6 0x25 0xE4 SHL PUSH5 0x736F6C6343 STOP ADDMOD SMOD STOP CALLER ",
"sourceMap": "68:324:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;201:31;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;89:39;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;201:31;;;;;;;;;;;;;:::o;89:39::-;;;;;;;;;;;;;;;;;:::o;7:139:1:-;53:5;91:6;78:20;69:29;;107:33;134:5;107:33;:::i;:::-;7:139;;;;:::o;152:329::-;211:6;260:2;248:9;239:7;235:23;231:32;228:119;;;266:79;;:::i;:::-;228:119;386:1;411:53;456:7;447:6;436:9;432:22;411:53;:::i;:::-;401:63;;357:117;152:329;;;;:::o;487:143::-;580:43;617:5;580:43;:::i;:::-;575:3;568:56;487:143;;:::o;636:118::-;723:24;741:5;723:24;:::i;:::-;718:3;711:37;636:118;;:::o;760:234::-;859:4;897:2;886:9;882:18;874:26;;910:77;984:1;973:9;969:17;960:6;910:77;:::i;:::-;760:234;;;;:::o;1000:222::-;1093:4;1131:2;1120:9;1116:18;1108:26;;1144:71;1212:1;1201:9;1197:17;1188:6;1144:71;:::i;:::-;1000:222;;;;:::o;1309:96::-;1346:7;1375:24;1393:5;1375:24;:::i;:::-;1364:35;;1309:96;;;:::o;1411:127::-;1456:7;1485:5;1474:16;;1491:41;1526:5;1491:41;:::i;:::-;1411:127;;;:::o;1544:126::-;1581:7;1621:42;1614:5;1610:54;1599:65;;1544:126;;;:::o;1676:77::-;1713:7;1742:5;1731:16;;1676:77;;;:::o;1759:127::-;1815:9;1848:32;1874:5;1848:32;:::i;:::-;1835:45;;1759:127;;;:::o;1892:180::-;1940:77;1937:1;1930:88;2037:4;2034:1;2027:15;2061:4;2058:1;2051:15;2201:117;2310:1;2307;2300:12;2324:113;2405:1;2398:5;2395:12;2385:46;;2411:18;;:::i;:::-;2385:46;2324:113;:::o;2443:122::-;2516:24;2534:5;2516:24;:::i;:::-;2509:5;2506:35;2496:63;;2555:1;2552;2545:12;2496:63;2443:122;:::o"
},
"gasEstimates": {
"creation": {
"codeDepositCost": "115200",
"executionCost": "70948",
"totalCost": "186148"
},
"external": {
"balance(address)": "2814",
"estadoDelContrato()": "2538"
}
},
"methodIdentifiers": {
"balance(address)": "e3d670d7",
"estadoDelContrato()": "0594cc69"
}
},
"abi": [
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "balance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "estadoDelContrato",
"outputs": [
{
"internalType": "enum Saldo.Estado",
"name": "",
"type": "uint8"
}
],
"stateMutability": "view",
"type": "function"
}
]
}
{
"compiler": {
"version": "0.8.7+commit.e28d00a7"
},
"language": "Solidity",
"output": {
"abi": [
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "balance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "estadoDelContrato",
"outputs": [
{
"internalType": "enum Saldo.Estado",
"name": "",
"type": "uint8"
}
],
"stateMutability": "view",
"type": "function"
}
],
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"settings": {
"compilationTarget": {
"contracts/Mapping.sol": "Saldo"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
},
"sources": {
"contracts/Mapping.sol": {
"keccak256": "0x6fa8c3ab12b7f75a0b2dc0a459c9a1bb89dea2ba48084e5adbdfb821795ba5ec",
"license": "GPL-3.0",
"urls": [
"bzz-raw://ad40a34f384fcc7d489c77663a01c89bfa40c2eb70a627aeaff9c99dbc0c04f4",
"dweb:/ipfs/QmWNL1kExxspForL8PePNGj35S2ciQ8x3Z1G4TmfzSvG74"
]
}
},
"version": 1
}
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
contract Clase{
struct Alumno{
string nombre;
uint documento;
}
Alumno[] public alumnos;
constructor(){
alumnos.push(Alumno({nombre:"Juan", documento:4697223}));
}
}
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0
contract Estructura{
int cantidad;
uint contidadSinSigno;
address direcion;
bool firmado;
constructor(bool estaFirmado){
direcion = msg.sender;
firmado = estaFirmado;
}
}
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.5.0 <0.9.0;
contract Saldo{
mapping(address => uint) public balance;
enum Estado {
Iniciado,
Finalizado
}
Estado public estadoDelContrato;
constructor() {
estadoDelContrato = Estado.Iniciado;
balance[msg.sender] = 1000;
estadoDelContrato = Estado.Finalizado;
}
}
{
"accounts": {
"account{1}": "0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2"
},
"linkReferences": {},
"transactions": [
{
"timestamp": 1638392180362,
"record": {
"value": "0",
"parameters": [],
"abi": "0x9494a0defa832e15eb7fbad925b320e7637ff96f2be3d75843e0c3599fea2faf",
"contractName": "Saldo",
"bytecode": "608060405234801561001957600080610016610148565b50505b506000600160006101000a8161002d6101b6565b8160ff02191690836001811115610076577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000610073610148565b50505b021790610081610219565b5050506103e86000805a61009361027e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081906100d7610219565b50505060018060006101000a816100ec6101b6565b8160ff02191690836001811115610135577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000610132610148565b50505b021790610140610219565b5050506102db565b632a2a7adb598160e01b8152600481016020815285602082015260005b86811015610183578086015181604084010152602081019050610165565b506020828760640184336000905af158600e01573d6000803e3d6000fd5b3d6001141558600a015760016000f35b505050565b6303daa959598160e01b8152836004820152602081602483336000905af158600e01573d6000803e3d6000fd5b3d6001141558600a015760016000f35b8051935060005b6040811015610214576000818301526020810190506101fa565b505050565b6322bd64c0598160e01b8152836004820152846024820152600081604483336000905af158600e01573d6000803e3d6000fd5b3d6001141558600a015760016000f35b60005b60408110156102795760008183015260208101905061025f565b505050565b6373509064598160e01b8152602081600483336000905af158600e01573d6000803e3d6000fd5b3d6001141558600a015760016000f35b8051935060005b60408110156102d6576000818301526020810190506102bc565b505050565b61030e806102ea6000396000f3fe6080604052348015610019576000806100166100d4565b50505b506004361061003f5760003560e01c80630594cc691461004d578063e3d670d71461006b575b60008061004a6100d4565b50505b61005561009b565b604051610062919061020a565b60405180910390f35b610085600480360381019061008091906101ba565b6100b5565b6040516100929190610225565b60405180910390f35b60016000906100a8610142565b906101000a900460ff1681565b60006020528060005260406000206000915090506100d1610142565b81565b632a2a7adb598160e01b8152600481016020815285602082015260005b8681101561010f5780860151816040840101526020810190506100f1565b506020828760640184336000905af158600e01573d6000803e3d6000fd5b3d6001141558600a015760016000f35b505050565b6303daa959598160e01b8152836004820152602081602483336000905af158600e01573d6000803e3d6000fd5b3d6001141558600a015760016000f35b8051935060005b60408110156101a057600081830152602081019050610186565b505050565b6000813590506101b4816102ee565b92915050565b6000602082840312156101d5576000806101d26100d4565b50505b60006101e3848285016101a5565b91505092915050565b6101f58161028f565b82525050565b61020481610285565b82525050565b600060208201905061021f60008301846101ec565b92915050565b600060208201905061023a60008301846101fb565b92915050565b600061024b82610265565b9050919050565b6000819050610260826102da565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061029a82610252565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000006000526021600452602460006102d66100d4565b5050565b600281106102eb576102ea6102a1565b5b50565b6102f781610240565b811461030b576000806103086100d4565b50505b5056",
"linkReferences": {},
"name": "",
"inputs": "()",
"type": "constructor",
"from": "account{1}"
}
}
],
"abis": {
"0x9494a0defa832e15eb7fbad925b320e7637ff96f2be3d75843e0c3599fea2faf": [
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "balance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "estadoDelContrato",
"outputs": [
{
"internalType": "enum Saldo.Estado",
"name": "",
"type": "uint8"
}
],
"stateMutability": "view",
"type": "function"
}
]
}
}
// Right click on the script name and hit "Run" to execute
(async () => {
try {
console.log('Running deployWithEthers script...')
const contractName = 'Storage' // Change this for other contract
const constructorArgs = [] // Put constructor args (if any) here for your contract
// Note that the script needs the ABI which is generated from the compilation artifact.
// Make sure contract is compiled and artifacts are generated
const artifactsPath = `browser/contracts/artifacts/${contractName}.json` // Change this for different path
const metadata = JSON.parse(await remix.call('fileManager', 'getFile', artifactsPath))
// 'web3Provider' is a remix global variable object
const signer = (new ethers.providers.Web3Provider(web3Provider)).getSigner()
let factory = new ethers.ContractFactory(metadata.abi, metadata.data.bytecode.object, signer);
let contract = await factory.deploy(...constructorArgs);
console.log('Contract Address: ', contract.address);
// The contract is NOT deployed yet; we must wait until it is mined
await contract.deployed()
console.log('Deployment successful.')
} catch (e) {
console.log(e.message)
}
})()
// Right click on the script name and hit "Run" to execute
(async () => {
try {
console.log('Running deployWithWeb3 script...')
const contractName = 'Storage' // Change this for other contract
const constructorArgs = [] // Put constructor args (if any) here for your contract
// Note that the script needs the ABI which is generated from the compilation artifact.
// Make sure contract is compiled and artifacts are generated
const artifactsPath = `browser/contracts/artifacts/${contractName}.json` // Change this for different path
const metadata = JSON.parse(await remix.call('fileManager', 'getFile', artifactsPath))
const accounts = await web3.eth.getAccounts()
let contract = new web3.eth.Contract(metadata.abi)
contract = contract.deploy({
data: metadata.data.bytecode.object,
arguments: constructorArgs
})
const newContractInstance = await contract.send({
from: accounts[0],
gas: 1500000,
gasPrice: '30000000000'
})
console.log('Contract deployed at address: ', newContractInstance.options.address)
} catch (e) {
console.log(e.message)
}
})()
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
import "remix_tests.sol"; // this import is automatically injected by Remix.
import "../contracts/3_Ballot.sol";
contract BallotTest {
bytes32[] proposalNames;
Ballot ballotToTest;
function beforeAll () public {
proposalNames.push(bytes32("candidate1"));
ballotToTest = new Ballot(proposalNames);
}
function checkWinningProposal () public {
ballotToTest.vote(0);
Assert.equal(ballotToTest.winningProposal(), uint(0), "proposal at index 0 should be the winning proposal");
Assert.equal(ballotToTest.winnerName(), bytes32("candidate1"), "candidate1 should be the winner name");
}
function checkWinninProposalWithReturnValue () public view returns (bool) {
return ballotToTest.winningProposal() == 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment