Created
April 12, 2022 12:16
-
-
Save neskito/0c783238b7d95d29a39cdab8530a6800 to your computer and use it in GitHub Desktop.
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.6.6+commit.6c089d02.js&optimize=false&runs=200&gist=
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Indicamos la version | |
pragma solidity >=0.4.4 <0.7.0; | |
contract funciones_globales{ | |
//Function msg.sender : Devuelbe la direccion del remitente de la llamada actual. | |
function MsgSender() public view returns(address){ | |
return msg.sender; | |
} | |
// Function Now: Devuelve el tiempo actual. | |
function Now() public view returns(uint){ | |
return now; | |
} | |
// Function block.coinbase: Nos devuelbe la direccion de minero. | |
function BlockCoinbase() public view returns(address){ | |
return block.coinbase; | |
} | |
// Function block.difficulty: Devuelbe el valor del bloque con el numero de ceros. | |
function BlockDifficulty() public view returns(uint){ | |
return block.difficulty; | |
} | |
// Function block.number: Nos devuelbe un entero con el numero de bloque actual. | |
function BlockNumber() public view returns(uint){ | |
return block.number; | |
} | |
// Function msg.sig: Nos devuelbe 4 bytes, que es el identificador de la funcion. | |
// Function tx.gasprice: Nos devuelbe en un entero el precio del gas de una transacion. | |
function txGasPrice() public view returns(uint){ | |
return tx.gasprice; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment