Skip to content

Instantly share code, notes, and snippets.

View santiago929's full-sized avatar

Santiago Garcia santiago929

View GitHub Profile
@santiago929
santiago929 / Week4...activity7-8.sol
Created October 24, 2025 15:29
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.7.6+commit.7338295f.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: Unlicense
pragma solidity >=0.6.0 <0.8.0;
contract week4Exercises {
uint[] public numArray;
constructor() {
numArray = [2,62,10,33,12,9];
}
// Function that returns the whole numArray
function returnArray() public view returns(uint256[] memory) {
@santiago929
santiago929 / Week3...activity5-6.sol
Created October 17, 2025 16:05
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.7.6+commit.7338295f.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: Unlicense
pragma solidity >=0.6.0 <0.8.0;
contract exerciseWeek3 {
uint256 number;
//str is not a valid data type. Use string instead
string word;
// Missing data location for string. Use memory.
@santiago929
santiago929 / Week2...call_data_payload.sol
Created October 14, 2025 17:23
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.30+commit.73712a01.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.25;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
// Idealy, the input after we click "transact", should match the output once we all the designed function
contract thirdExample is ERC721{
function getSelector(string memory _function) public view returns(bytes4) {
return bytes4(keccak256(bytes(_function)));