Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

Smart contract deployment to RSK Tesetnet

Transaction for deployment: 0xd7d2d2c56e96def34c3ae20c3cd6fdef887a64ac4b2c7fb6b483918b8c278413 https://explorer.testnet.rsk.co/tx/0xd7d2d2c56e96def34c3ae20c3cd6fdef887a64ac4b2c7fb6b483918b8c278413

Smart contract address: 0x7cee215c96850f39b6076d52363e877272a8f00c https://explorer.testnet.rsk.co/address/0x7cee215c96850f39b6076d52363e877272a8f00c

ABI:

[
        {
                "constant": false,
                "inputs": [
                        {
                                "internalType": "bytes3",
                                "name": "colour",
                                "type": "bytes3"
                        },
                        {
                                "internalType": "uint8",
                                "name": "doors",
                                "type": "uint8"
                        },
                        {
                                "internalType": "uint256",
                                "name": "distance",
                                "type": "uint256"
                        },
                        {
                                "internalType": "uint16",
                                "name": "lat",
                                "type": "uint16"
                        },
                        {
                                "internalType": "uint16",
                                "name": "lon",
                                "type": "uint16"
                        }
                ],
                "name": "addCar",
                "outputs": [
                        {
                                "internalType": "uint256",
                                "name": "carId",
                                "type": "uint256"
                        }
                ],
                "payable": true,
                "stateMutability": "payable",
                "type": "function"
        },
        {
                "inputs": [],
                "payable": false,
                "stateMutability": "nonpayable",
                "type": "constructor"
        },
        {
                "anonymous": false,
                "inputs": [
                        {
                                "indexed": true,
                                "internalType": "uint256",
                                "name": "fromCar",
                                "type": "uint256"
                        },
                        {
                                "indexed": true,
                                "internalType": "uint256",
                                "name": "atCar",
                                "type": "uint256"
                        }
                ],
                "name": "CarHonk",
                "type": "event"
        },
        {
                "constant": false,
                "inputs": [
                        {
                                "internalType": "uint256",
                                "name": "carId",
                                "type": "uint256"
                        }
                ],
                "name": "driveCar",
                "outputs": [],
                "payable": false,
                "stateMutability": "nonpayable",
                "type": "function"
        },
        {
                "constant": false,
                "inputs": [
                        {
                                "internalType": "uint256",
                                "name": "carId",
                                "type": "uint256"
                        },
                        {
                                "internalType": "uint256",
                                "name": "otherCarId",
                                "type": "uint256"
                        }
                ],
                "name": "honkCar",
                "outputs": [],
                "payable": false,
                "stateMutability": "nonpayable",
                "type": "function"
        },
        {
                "constant": false,
                "inputs": [
                        {
                                "internalType": "uint256",
                                "name": "carId",
                                "type": "uint256"
                        },
                        {
                                "internalType": "uint16",
                                "name": "lat",
                                "type": "uint16"
                        },
                        {
                                "internalType": "uint16",
                                "name": "lon",
                                "type": "uint16"
                        }
                ],
                "name": "parkCar",
                "outputs": [],
                "payable": false,
                "stateMutability": "nonpayable",
                "type": "function"
        },
        {
                "constant": true,
                "inputs": [
                        {
                                "internalType": "uint256",
                                "name": "",
                                "type": "uint256"
                        }
                ],
                "name": "cars",
                "outputs": [
                        {
                                "internalType": "bytes3",
                                "name": "colour",
                                "type": "bytes3"
                        },
                        {
                                "internalType": "uint8",
                                "name": "doors",
                                "type": "uint8"
                        },
                        {
                                "internalType": "uint256",
                                "name": "distance",
                                "type": "uint256"
                        },
                        {
                                "internalType": "uint16",
                                "name": "lat",
                                "type": "uint16"
                        },
                        {
                                "internalType": "uint16",
                                "name": "lon",
                                "type": "uint16"
                        },
                        {
                                "internalType": "enum Cars.CarStatus",
                                "name": "status",
                                "type": "uint8"
                        },
                        {
                                "internalType": "address",
                                "name": "owner",
                                "type": "address"
                        }
                ],
                "payable": false,
                "stateMutability": "view",
                "type": "function"
        },
        {
                "constant": true,
                "inputs": [],
                "name": "numCars",
                "outputs": [
                        {
                                "internalType": "uint256",
                                "name": "",
                                "type": "uint256"
                        }
                ],
                "payable": false,
                "stateMutability": "view",
                "type": "function"
        }
]

Bytecode:

60806040526000805534801561001457600080fd5b50610c65806100246000396000f3fe6080604052600436106100555760003560e01c80632419e9c81461005a5780636977eaaa14610085578063cb6bc4ad146100ca578063d1aaff7014610105578063da54dc701461019a578063f7746e36146101f1575b600080fd5b34801561006657600080fd5b5061006f6102fa565b6040518082815260200191505060405180910390f35b34801561009157600080fd5b506100c8600480360360408110156100a857600080fd5b810190808035906020019092919080359060200190929190505050610300565b005b3480156100d657600080fd5b50610103600480360360208110156100ed57600080fd5b81019080803590602001909291905050506104e4565b005b610184600480360360a081101561011b57600080fd5b8101908080357cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19169060200190929190803560ff16906020019092919080359060200190929190803561ffff169060200190929190803561ffff16906020019092919050505061068e565b6040518082815260200191505060405180910390f35b3480156101a657600080fd5b506101ef600480360360608110156101bd57600080fd5b8101908080359060200190929190803561ffff169060200190929190803561ffff1690602001909291905050506108ae565b005b3480156101fd57600080fd5b5061022a6004803603602081101561021457600080fd5b8101908080359060200190929190505050610abb565b60405180887cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020018760ff1660ff1681526020018681526020018561ffff1661ffff1681526020018461ffff1661ffff1681526020018360018111156102ae57fe5b60ff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200197505050505050505060405180910390f35b60005481565b813373ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060020160059054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146103d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f796f75206e65656420746f206f776e2074686973206361720000000000
00000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166001600084815260200190815260200160002060020160059054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156104b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f6f7468657220636172206d75737420657869737400000000000000000000000081525060200191505060405180910390fd5b81837f3d2617031a0ef419708777b5ba73f450442507209fef7beef030f04bbfdbc5a960405160405180910390a3505050565b803373ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060020160059054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f796f75206e65656420746f206f776e207468697320636172000000000000000081525060200191505060405180910390fd5b8160018060018111156105cb57fe5b6001600084815260200190815260200160002060020160049054906101000a900460ff1660018111156105fa57fe5b14610650576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180610c106021913960400191505060405180910390fd5b60006001600086815260200190815260200160002060020160046101000a81548160ff0219169083600181111561068357fe5b021790555050505050565b600067016345785d8a000034116106f0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180610bea6026913960400191505060405180910390fd5b60008081546001019190508190559050610708610b60565b6040518060e00160405280887cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020018760ff1681526020018681526020018561ffff1681526020018461ffff16815260200160018081111561076857fe5b81526020013373ffffffffffffffffffffffffffffffffffffffff16815250905080600160008481526020019081526020016000206000820151816000016000610100
0a81548162ffffff021916908360e81c021790555060208201518160000160036101000a81548160ff021916908360ff1602179055506040820151816001015560608201518160020160006101000a81548161ffff021916908361ffff16021790555060808201518160020160026101000a81548161ffff021916908361ffff16021790555060a08201518160020160046101000a81548160ff0219169083600181111561085557fe5b021790555060c08201518160020160056101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509050505095945050505050565b823373ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060020160059054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610986576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f796f75206e65656420746f206f776e207468697320636172000000000000000081525060200191505060405180910390fd5b83600080600181111561099557fe5b6001600084815260200190815260200160002060020160049054906101000a900460ff1660018111156109c457fe5b14610a1a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180610c106021913960400191505060405180910390fd5b600180600088815260200190815260200160002060020160046101000a81548160ff02191690836001811115610a4c57fe5b0217905550846001600088815260200190815260200160002060020160006101000a81548161ffff021916908361ffff160217905550836001600088815260200190815260200160002060020160026101000a81548161ffff021916908361ffff160217905550505050505050565b60016020528060005260406000206000915090508060000160009054906101000a900460e81b908060000160039054906101000a900460ff16908060010154908060020160009054906101000a900461ffff16908060020160029054906101000a900461ffff16908060020160049054906101000a900460ff16908060020160059054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905087565b6040518060e0016040528060007cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200160
0060ff16815260200160008152602001600061ffff168152602001600061ffff16815260200160006001811115610bc657fe5b8152602001600073ffffffffffffffffffffffffffffffffffffffff168152509056fe596f75206e656564206174206c6561737420302e312045544820746f20676574206120636172636172206973206e6f7420696e2074686520726571756972656420737461747573a265627a7a72315820ff94d4000aad5d98f3ef258470937642940e7ed33852b468f516357143025be664736f6c63430005110032
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.