Skip to content

Instantly share code, notes, and snippets.

View nervehammer's full-sized avatar
🏠
Working from home

Suraj Rawat nervehammer

🏠
Working from home
View GitHub Profile
@nervehammer
nervehammer / VanityURL.sol
Last active June 27, 2019 12:59
A sample smart contract which we will modify later to accept relayed transactions
pragma solidity ^0.5.5;
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "openzeppelin-solidity/contracts/lifecycle/Pausable.sol";
contract VanityURL is Ownable, Pausable {
mapping (string => address) private vanityAddress;
mapping (address => string ) private addressVanity;
event VanityReserved(address indexed to, string vanityUrl);
pragma solidity ^0.5.5;
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "openzeppelin-solidity/contracts/lifecycle/Pausable.sol";
import "tabookey-gasless/contracts/IRelayHub.sol";
import "tabookey-gasless/contracts/RelayRecipient.sol";
contract GaslessVanityURL is Ownable, Pausable, RelayRecipient {
mapping (string => address) private vanityAddress;
@nervehammer
nervehammer / sendtransaction.js
Created May 22, 2019 14:17
send transaction example.
async function sendTransaction() {
const tx = {
gasPrice: '0x09184e72a000',
gasLimit: '0x2710',
to: '0x0000000000000000000000000000000000000000',
value: '0x00',
data: '0x7f7465737432000000000000000000000000000000000000000000000000000000600057'
}
@nervehammer
nervehammer / initializewallet.js
Created May 22, 2019 13:46
initialization example
async function initializeWallet(encryptedMnemonic) {
let address = await SpringWallet.initializeAndUnlockWallet(encryptedMnemonic);
return address;
}
async function encryptUserMnemonic(plainTextMnemonic) {
let encryptedMnemonic = await SpringWallet.encryptMnemonic(plainTextMnemonic);
return encryptedMnemonic;
}