Skip to content

Instantly share code, notes, and snippets.

@NukeManDan
Last active November 10, 2020 02:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NukeManDan/9a4ad042ab4b22661184c47c18edb76e to your computer and use it in GitHub Desktop.
Save NukeManDan/9a4ad042ab4b22661184c47c18edb76e to your computer and use it in GitHub Desktop.
Plasm deploy challenge

Contract Deployment on Plasm

LIVE on the Dusty testnet with address:

afAD4ktuW9Dauz8xC3zw5G1h2XTQchP2rVg7TY1LQmY6wqE

See storage.sol for the code deployed.


Compiled with solang v0.1.5

NOTE: needed to MANUALLY change the Storage.json file compiled to use u128 INSTSEAD of u256 to be used with the UI

Code on chain: https://apps.plasmnet.io/#/explorer/query/0x5d737a5098e66f08ad4884c1d5af023ac203ad032557fe79cacd1632ebe131d9

Instance on chain: https://apps.plasmnet.io/#/explorer/query/0xc402a8e2c9eb8755db2f76b697ed0d5a2e57edbb9f95c6762c9d538bec2f6bb7

{
"contract": {
"authors": [
"unknown"
],
"description": "Storage",
"name": "Storage",
"version": "0.0.1"
},
"metadataVersion": "0.1.0",
"source": {
"compiler": "solang 0.1.5",
"hash": "0x151b963e7f49fce393841887628fd3191710f225ca786ac5a05f20f0a32881dc",
"language": "Solidity 0.1.5"
},
"spec": {
"constructors": [
{
"args": [],
"docs": [
""
],
"name": "new",
"selector": "0x861731d5"
}
],
"events": [],
"messages": [
{
"args": [],
"docs": [
""
],
"mutates": false,
"name": "retrieve",
"payable": false,
"return_type": {
"display_name": [
"u128"
],
"type": 1
},
"selector": "0x2e64cec1"
},
{
"args": [
{
"name": "num",
"type": {
"display_name": [
"u128"
],
"type": 1
}
}
],
"docs": [
""
],
"mutates": true,
"name": "store",
"payable": false,
"return_type": null,
"selector": "0x6057361d"
}
]
},
"storage": {
"struct": {
"fields": [
{
"layout": {
"cell": {
"key": "0x0000000000000000000000000000000000000000000000000000000000000000",
"ty": 1
}
},
"name": "number"
}
]
}
},
"types": [
{
"def": {
"primitive": "u128"
}
}
]
}
pragma solidity ^0.7.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;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment