public class ContractStaticImports
extends Object
It is suggested that you use a static import to include these values and methods in the context of your contract code:
import static com.u7.ContractStaticImports.*;
Note that these members and methods are not intended to be accessed within the context of running Java code on the JVM at this time. They are simply placeholders that are used to help express your desired contract behavior in Java code.
A future release may implement JVM based simulation of Blockchain Side execution, however this feature is not available yet.
To put it another way, *only* access these from inside code that is intended for execution on the blockchain.
Modifier and Type | Field and Description |
---|---|
static ABI |
abi |
static Block |
block
Block object that contains values associated with the current block.
|
static Uint |
days
Convenience constant representing the number of seconds in a day (86400)
|
static long |
daysMS |
static Uint |
ether
Convenience constant representing 1 FINNEY (10^18 WEI)
|
static Uint |
finney
Convenience constant representing 1 FINNEY (10^15 WEI)
|
static Uint |
hours
Convenience constant representing the number of seconds in a hour (3600)
|
static long |
hoursMS |
static Uint |
minutes
Convenience constant representing the number of seconds in a minute (60)
|
static long |
minutesMS |
static Message |
msg
Message object that contains values associated with the current message.
|
static Uint |
now
The current time in units of seconds since the unix epoch
|
static Uint |
seconds
Convenience constant representing the number of seconds in a second (1)
|
static long |
secondsMS |
static Uint |
szabo
Convenience constant representing 1 FINNEY (10^12 WEI)
|
static Transaction |
tx
The transaction details of this current transaction.
|
static Uint |
weeks
Convenience constant representing the number of seconds in a week (604800)
|
static long |
weeksMS |
static Uint |
wei
Convenience constant representing 1 WEI
|
Constructor and Description |
---|
ContractStaticImports() |
Modifier and Type | Method and Description |
---|---|
static void |
__EmitSolidityCode__(String solidityCode)
Deprecated.
|
static void |
__ERROR__(Object... args)
Generate an artificial source code error when used in contract code.
|
static void |
__ReplaceAllSolidityCode__(String solidityCode)
Deprecated.
|
static void |
__WARNING__(Object... args)
Generate an artificial source code warning when used in contract code.
|
static Uint |
addmod(Uint x,
Uint y,
Uint k)
Impliments modulo addition of (x + y) mod k
|
static Bytes32 |
blockhash(Uint blockNumber) |
static Address |
ecrecover(Bytes32 hash,
Uint8 v,
Bytes32 r,
Bytes32 s)
Recover the signing ethereum address from data that has been signed with an Eliptic Curve signature.
|
static void |
emitEvent(Object a)
Emit an Event Class instance (should be annotated with
EventClass |
static AddressPayable |
getAddressOfCurrentContract()
Returns the address of the currently executing contract.
|
static Bytes32 |
keccak256(Bytes arg)
performs the keccak256 hashing function
|
static void |
log0(Bytes32 a) |
static void |
log1(Bytes32 a,
Bytes32 b) |
static void |
log2(Bytes32 a,
Bytes32 b,
Bytes32 c) |
static void |
log3(Bytes32 a,
Bytes32 b,
Bytes32 c,
Bytes32 d) |
static void |
log4(Bytes32 a,
Bytes32 b,
Bytes32 c,
Bytes32 d,
Bytes32 e) |
static Uint |
mulmod(Uint x,
Uint y,
Uint k)
Impliments modulo multiplication of (x * y) mod k
|
static void |
require(boolean condition)
Similar to Java 'assert'.
|
static void |
require(boolean condition,
String message)
Similar to Java 'assert'.
|
static void |
revert()
Similar to Java 'assert false'.
|
static Bytes20 |
ripemd160(Object... args) |
static void |
selfdestruct(Address recipient) |
static void |
suicide(Address recipient) |
static <T> T |
toContract(Class<T> contractClass,
Address a)
Helper method to convert an address into a reference to the appropriate contract class
that is deployed at that address.
|
public static ABI abi
public static Block block
Block
public static final Uint days
public static final long daysMS
public static final Uint ether
public static final Uint finney
public static final Uint hours
public static final long hoursMS
public static final Uint minutes
public static final long minutesMS
public static Message msg
Message
public static Uint now
public static final Uint seconds
public static final long secondsMS
public static final Uint szabo
public static Transaction tx
public static final Uint weeks
public static final long weeksMS
public static final Uint wei
@Deprecated public static void __EmitSolidityCode__(String solidityCode)
public static void __ERROR__(Object... args)
@Deprecated public static void __ReplaceAllSolidityCode__(String solidityCode)
public static void __WARNING__(Object... args)
public static Uint addmod(Uint x, Uint y, Uint k)
x
- y
- k
- public static Address ecrecover(Bytes32 hash, Uint8 v, Bytes32 r, Bytes32 s)
hash
- v
- r
- s
- public static void emitEvent(Object a)
EventClass
a
- an instance of an Event Class objectpublic static AddressPayable getAddressOfCurrentContract()
public static Bytes32 keccak256(Bytes arg)
arg
- the value to hashpublic static void log0(Bytes32 a)
public static Uint mulmod(Uint x, Uint y, Uint k)
x
- y
- k
- public static void require(boolean condition)
condition
- the condition that hopefully will be truepublic static void require(boolean condition, String message)
condition
- the condition that hopefully will be truemessage
- a message that describes what went wrong if condition is false. Curently there is no
way to retrieve this message value.public static void revert() throws Error
Error
- this method is tagged as throwing an Error to represent the fact that the flow
of control will terminate after this method is invoked.public static Bytes20 ripemd160(Object... args)
public static void selfdestruct(Address recipient)
public static void suicide(Address recipient)
public static <T> T toContract(Class<T> contractClass, Address a)
T
- The type of the contract classcontractClass
- the class type to cast the address intoa
- the address of the deployed contract