Skip to content

Instantly share code, notes, and snippets.

View developeruche's full-sized avatar
🤓
Building

Developer Uche developeruche

🤓
Building
View GitHub Profile
@developeruche
developeruche / e2e.test.rs
Last active March 18, 2023 14:55
This is a code snippet for the e2e testing functionality in t he ink framework
/// This is how you'd write end-to-end (E2E) or integration tests for ink! contracts.
///
/// When running these you need to make sure that you:
/// - Compile the tests with the `e2e-tests` feature flag enabled (`--features e2e-tests`)
/// - Are running a Substrate node which contains `pallet-contracts` in the background
#[cfg(all(test, feature = "e2e-tests"))]
mod e2e_tests {
/// Imports all the definitions from the outer scope so we can use them here.
use super::*;
contract Campaign {
struct Request {
string description;
uint256 value;
address recipient;
bool complete;
uint256 approvalCount;
mapping(address => bool) approvals;
}
pragma solidity ^0.4.18;
contract WFIL {
string public name = "Wrapped FIL";
string public symbol = "WFIL";
uint8 public decimals = 18;
address private admin;
function WFIL() public {
admin = msg.sender;
[
{
"inputs": [],
"name": "INVALID_INPUT",
"type": "error"
},
{
"inputs": [],
"name": "INVALID_POOL",
"type": "error"
async function getPermitSignature(signer: any, token: any, spender: any, value: any, deadline: any) {
const [nonce, name, version, chainId] = await Promise.all([
token.nonces(signer.address),
token.name(),
"1",
80001,
])
console.log(nonce, name, version, chainId)

0x2d57978b63d19e5881aeae3067cdce3439571aa9 NIV

0x5c4432328b97136e6eaf8295d61f62f634f6360b NIK

0x4c7e871f32f0df6af752b4f4b9e064f71d1c3d4c MON

0xb58da0b9d67c2b34e9a4d5c9a16b48172fdc24df AMQ

0xde97b28596f6e13586f3d01cb5cdeefca482c51a DQ2

[
{
"inputs": [
{
"internalType": "string",
"name": "_name",
"type": "string"
},
{
"internalType": "string",

0xb6a36afae5982bf8887c8bec515bc7d1382e6334 NIV

0xddec3334f314038b8569f42dce6c148e0fe889af NIK

0x1cc9d1216860d65fb2c74364d5a0035e840cbcda MON

0x9058b7f3158955370d2932f23f8c4bda580df81e AMQ

0x59826e6ad3434528ce833f95c76fc1a565368b4a DQ2

[
{
"inputs": [],
"name": "INSUFFICENT_POINTS",
"type": "error"
},
{
"inputs": [],
"name": "INVALID_INPUT",
"type": "error"
@developeruche
developeruche / sec.json
Created January 17, 2023 07:15
Me Protocol Sec Module
[
{
"inputs": [
{
"internalType": "address",
"name": "_token0",
"type": "address"
},
{
"internalType": "address",