Skip to content

Instantly share code, notes, and snippets.

View vince0656's full-sized avatar
💭
Building

Vincent Almeida vince0656

💭
Building
View GitHub Profile
{
"name": "MEV warrior",
"description": "Join a StakeHouse",
"image": "https://user-images.githubusercontent.com/15893673/134331001-a99ed9e0-38d4-4024-8063-e4ef5b3ad5b0.png"
}
{
"name": "$LIDO",
"description": "Offers over 50 ETH only",
"image": "https://assets-global.website-files.com/5f3306add5c511ca4cf17da9/6090276740b217895bb96828_1f6cc4c1-5521-4f12-8560-12072371551b.jpeg"
}
@vince0656
vince0656 / matt_erc721_metadata.json
Created September 20, 2021 17:25
matt metadata
{
"name": "COIN",
"description": "COIN ticker - I will accept 32 ETH for this ticker",
"image": "https://i.ibb.co/By0VbLK/stakehouse-dp.png"
}
#!/bin/bash
docker-compose down -v;
if [ -d "data" ]
then
echo "Found old data for the graph node - deleting it";
# we need to sudo this to remove system locked files
sudo rm -rf data/;
fi
contract rDAIRelayHub is RelayHub {
using SafeMath for uint256;
address ETH_PROXY = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
function refuelFor(address target, IRToken rDai, IERC20 dai, KyberNetworkInterface kyber) external {
// 1. Claim earned rDAI interest
address self = address(this);
bool interestClaimSuccess = rDai.payInterest(self);
require(interestClaimSuccess, "Failed to claim interest earned for target");
submitBid() {
if(this.isDrizzleInitialized) {
const bidContractMethod = this.drizzleInstance.contracts[this.contractName].methods['bid'];
bidContractMethod.cacheSend(this.parameter, { value: this.bidInWei });
} else {
alert("Drizzle doesn't seem to be initialised / ready");
}
}
get minBid(): number {
if (this.isDrizzleInitialized) {
const min = this.getContractData({
contract: this.contractName,
method: 'minBid'
});
let minInEther: number = etherFromWei(this.drizzleInstance, min, DEFAULT_MIN_BID);
return minInEther;
created() {
this.$store.dispatch('drizzle/REGISTER_CONTRACT', {
contractName: this.contractName, // i.e. TwistedAuctionMock
method: 'minBid',
methodArgs: [] // No args required for this method
});
}
function getEventsByName(contractInstances: any, contractName: string, eventName: string){
const allEvents = contractInstances[contractName].events;
return allEvents.filter((event: any) => event.event === eventName)
.filter((event: any, index: number, self: any) => {
// remove any duplicates
return index == self.findIndex((obj: any) => {
return JSON.stringify(obj) === JSON.stringify(event);
});
});
}
// @ts-ignore
import drizzleVuePlugin from '@drizzle/vue-plugin';
import drizzleOptions from './drizzle-options';
Vue.use(drizzleVuePlugin, { store, drizzleOptions });