Skip to content

Instantly share code, notes, and snippets.

@Turupawn
Last active April 1, 2025 19:56
Show Gist options
  • Save Turupawn/5d9bec45c11b475ebe70f22c621f65b5 to your computer and use it in GitHub Desktop.
Save Turupawn/5d9bec45c11b475ebe70f22c621f65b5 to your computer and use it in GitHub Desktop.
Verifying locally

services/server/src/config/default.js

...
  storage: {
    // read option will be the "source of truth" where the contracts read from for the API requests.
    read: RWStorageIdentifiers.RepositoryV1, // CHANGED HERE
    // User request will NOT fail if saving to these fail, but only log a warning
    writeOrWarn: [
      WStorageIdentifiers.RepositoryV2, // CHANGED HERE
      RWStorageIdentifiers.RepositoryV1,
    ],
    // The user request will fail if saving to these fail
    writeOrErr: [
      WStorageIdentifiers.RepositoryV2,
      RWStorageIdentifiers.RepositoryV1, // CHANGED HERE
    ],
  },
...
nvm use 22
npm install
npx lerna run build
cd services/server
npm start

Pato2_metadata.json

{
	"compiler": {
		"version": "0.8.26+commit.8a97fa7a"
	},
	"language": "Solidity",
	"output": {
		"abi": [
			{
				"inputs": [],
				"name": "get",
				"outputs": [
					{
						"internalType": "uint256",
						"name": "",
						"type": "uint256"
					}
				],
				"stateMutability": "view",
				"type": "function"
			},
			{
				"inputs": [],
				"name": "get4",
				"outputs": [
					{
						"internalType": "uint256",
						"name": "",
						"type": "uint256"
					}
				],
				"stateMutability": "view",
				"type": "function"
			},
			{
				"inputs": [
					{
						"internalType": "uint256",
						"name": "num",
						"type": "uint256"
					}
				],
				"name": "store",
				"outputs": [],
				"stateMutability": "nonpayable",
				"type": "function"
			}
		],
		"devdoc": {
			"kind": "dev",
			"methods": {},
			"version": 1
		},
		"userdoc": {
			"kind": "user",
			"methods": {},
			"version": 1
		}
	},
	"settings": {
		"compilationTarget": {
			"contracts/XX.sol": "Pato2"
		},
		"evmVersion": "cancun",
		"libraries": {},
		"metadata": {
			"bytecodeHash": "ipfs"
		},
		"optimizer": {
			"enabled": false,
			"runs": 200
		},
		"remappings": []
	},
	"sources": {
		"contracts/XX.sol": {
			"keccak256": "0xb0113f7e6beff80a2de65e77b711eeebe9c251201ad6604e4748ada7cbdc5f4a",
			"license": "GPL-3.0",
			"urls": [
				"bzz-raw://0a7154e47704c188ba43c1adb072a7a7c7db468d5e8e36115d76d3df74855fd4",
				"dweb:/ipfs/QmT16rR6VSaWy8fSa8rXaEUpxKE3UisM4uZF9XFQLvSKZn"
			]
		}
	},
	"version": 1
}

Pato2.sol

// SPDX-License-Identifier: GPL-3.0

pragma solidity >=0.8.2 <0.9.0;

contract Pato2 {

    uint256 number;

    function store(uint256 num) public {
        number = num;
    }

    function get() public view returns(uint256) {
        return number;
    }

    function get4() public view returns(uint256) {
        return number * 4;
    }
}
curl -X POST \
     -F '[email protected]' \
     -F 'files=@Pato2_metadata.json' \
     -F 'address=0xfB36105eccA11c56E6fE64E2EaC06d5c6BEEaf30' \
     -F 'chain=11155111' \
     http://localhost:5555/verify
$ curl -X POST http://localhost:5555/verify/emojity   -H "Content-Type: application/json"   -d '{
    "address": "0xfe5Ae1Dc53AE8D10d6cc0d7d1800fa47AA346122",
    "chain": "11155111",
    "files": {
      "Pato2.vy": "# @version 0.3.79"
    },
    "contractPath": "Pato22.vy",
    "contractName": "Pato2",
    "compilerVersion": "0.3.7"
  }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment