Skip to content

Instantly share code, notes, and snippets.

@tory10027
tory10027 / .deps...npm....resolution-index.json
Created April 10, 2026 10:58
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.34+commit.80d5c536.js&optimize=undefined&runs=200&gist=
{
"contracts/範例程式_1/12_Array.sol": {
"__sources__": {
"contracts/範例程式_1/12_Array.sol": {
"content": "// SPDX-License-Identifier: MIT\r\n\r\npragma solidity ^0.8.28;\t\r\n\r\ncontract Array {\r\n \r\n int[] myArray1; \r\n \r\n constructor(){\r\n \r\n }\r\n \r\n function setValue( uint index, int value) public {\r\n require(index < myArray1.length, \"index error\");\r\n myArray1[index] = value;\t\r\n }\r\n \r\n function getValue( uint index ) public view returns( int value){\r\n require(index < myArray1.length, \"index error\");\r\n value = myArray1[index];\r\n }\r\n \r\n function getLength() public pure returns( uint256){\r\n return [uint256(3),4,5,6].length;\r\n //return myArray1.length;\r\n }\r\n \r\n function addValue( int value) public {\r\n myArray1.push(value);\r\n }\r\n\r\n function test1() public view returns( uint256[] memory a, uint256 len){\r\n a = new uint256[](7);\r\n
@tory10027
tory10027 / .deps...npm....resolution-index.json
Last active April 10, 2026 10:57
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.34+commit.80d5c536.js&optimize=undefined&runs=200&gist=
{
"contracts/範例程式_1/12_Array.sol": {
"__sources__": {
"contracts/範例程式_1/12_Array.sol": {
"content": "// SPDX-License-Identifier: MIT\r\n\r\npragma solidity ^0.8.28;\t\r\n\r\ncontract Array {\r\n \r\n int[] myArray1; \r\n \r\n constructor(){\r\n \r\n }\r\n \r\n function setValue( uint index, int value) public {\r\n require(index < myArray1.length, \"index error\");\r\n myArray1[index] = value;\t\r\n }\r\n \r\n function getValue( uint index ) public view returns( int value){\r\n require(index < myArray1.length, \"index error\");\r\n value = myArray1[index];\r\n }\r\n \r\n function getLength() public pure returns( uint256){\r\n return [uint256(3),4,5,6].length;\r\n //return myArray1.length;\r\n }\r\n \r\n function addValue( int value) public {\r\n myArray1.push(value);\r\n }\r\n\r\n function test1() public view returns( uint256[] memory a, uint256 len){\r\n a = new uint256[](7);\r\n