update contracts

This commit is contained in:
Michel Fromme
2023-06-26 17:08:20 +02:00
parent fdf96948a5
commit 524a5add62
7 changed files with 440 additions and 144 deletions
+4 -2
View File
@@ -42,6 +42,7 @@ function isMobileFunc() {
provide("isMobile", isMobile); provide("isMobile", isMobile);
onMounted(async () => { onMounted(async () => {
//more or less tests
var test = await walletStore.isConnected(); var test = await walletStore.isConnected();
console.log("test", test); console.log("test", test);
@@ -60,11 +61,12 @@ onMounted(async () => {
); );
var getGoal = await memeBurnerStore.getGoal(2); var getGoal = await memeBurnerStore.getGoal(2);
var getSacrificedMeme = await memeBurnerStore.getSacrificedMeme(1, "0x60dd9D0e015115b9aEf61bEDCcBE1390CEEfC247");
console.log("getSacrificedMeme", getSacrificedMeme);
console.log("getGoal", getGoal); console.log("getGoal", getGoal);
console.log("memeBurnerStore.contract", memeBurnerStore.contract); console.log("memeBurnerStore.contract", memeBurnerStore.contract);
console.log("list", list.value); console.log("list", list.value);
const currentRound = await contract.methods.currentRound().call(); const currentRound = await memeBurnerStore.getCurrentRound();
const rounds = await contract.methods.rounds("0x0e349D42C125acA39ea58024FFC23ED0fE5feE32").call(); const rounds = await contract.methods.rounds("0x0e349D42C125acA39ea58024FFC23ED0fE5feE32").call();
console.log("currentRound", currentRound); console.log("currentRound", currentRound);
console.log("rounds", rounds); console.log("rounds", rounds);
+8 -8
View File
@@ -1,6 +1,6 @@
{ {
"contractName": "LiquidityOwner", "contractName": "LiquidityOwner",
"contractAddress": "0xF58FC44A2862335F3577253EC544488006aF676A", "contractAddress": "0x2Cdea6EA15303b1744F05f62E6921479D31AcBC9",
"abi": [ "abi": [
{ {
"inputs": [ "inputs": [
@@ -83,7 +83,7 @@
"inputs": [ "inputs": [
{ {
"internalType": "uint256[]", "internalType": "uint256[]",
"name": "tokenIds", "name": "liquidityTokenIds",
"type": "uint256[]" "type": "uint256[]"
} }
], ],
@@ -198,7 +198,7 @@
"inputs": [ "inputs": [
{ {
"internalType": "uint256[]", "internalType": "uint256[]",
"name": "tokenIds", "name": "positionsToCancel",
"type": "uint256[]" "type": "uint256[]"
}, },
{ {
@@ -240,22 +240,22 @@
"inputs": [ "inputs": [
{ {
"internalType": "address", "internalType": "address",
"name": "operator", "name": "",
"type": "address" "type": "address"
}, },
{ {
"internalType": "address", "internalType": "address",
"name": "from", "name": "",
"type": "address" "type": "address"
}, },
{ {
"internalType": "uint256", "internalType": "uint256",
"name": "tokenId", "name": "",
"type": "uint256" "type": "uint256"
}, },
{ {
"internalType": "bytes", "internalType": "bytes",
"name": "data", "name": "",
"type": "bytes" "type": "bytes"
} }
], ],
@@ -267,7 +267,7 @@
"type": "bytes4" "type": "bytes4"
} }
], ],
"stateMutability": "nonpayable", "stateMutability": "pure",
"type": "function" "type": "function"
}, },
{ {
+54 -30
View File
@@ -1,6 +1,6 @@
{ {
"contractName": "MemeBurner", "contractName": "MemeBurner",
"contractAddress": "0x5c7077b0424c0e425B16363AdA59f1D72914C5c5", "contractAddress": "0x35640264BA900f4AF2b9e3743EA0578eCcF181bE",
"abi": [ "abi": [
{ {
"inputs": [ "inputs": [
@@ -146,35 +146,6 @@
"name": "MemeSacrificed", "name": "MemeSacrificed",
"type": "event" "type": "event"
}, },
{
"inputs": [
{
"internalType": "uint256",
"name": "goal",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "achieved",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "amountOfAsset",
"type": "uint256"
}
],
"name": "_calculateLinearDecreasingReward",
"outputs": [
{
"internalType": "uint256",
"name": "reward",
"type": "uint256"
}
],
"stateMutability": "pure",
"type": "function"
},
{ {
"inputs": [ "inputs": [
{ {
@@ -206,6 +177,59 @@
"stateMutability": "view", "stateMutability": "view",
"type": "function" "type": "function"
}, },
{
"inputs": [
{
"internalType": "address",
"name": "memeToSacrifice",
"type": "address"
},
{
"internalType": "uint256",
"name": "amountToSacrifice",
"type": "uint256"
}
],
"name": "getRewardFor",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "roundNumber",
"type": "uint256"
},
{
"internalType": "address",
"name": "meme",
"type": "address"
}
],
"name": "getSacrificedMeme",
"outputs": [
{
"internalType": "bool",
"name": "participation",
"type": "bool"
},
{
"internalType": "uint256",
"name": "amountAchieved",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{ {
"inputs": [], "inputs": [],
"name": "liquidityAmountLimit", "name": "liquidityAmountLimit",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"contractName": "MemeToken", "contractName": "MemeToken",
"contractAddress": "0x0e349D42C125acA39ea58024FFC23ED0fE5feE32", "contractAddress": "0x7D3e23Efa01745709b2123C4D17bcab86cBc55D1",
"abi": [ "abi": [
{ {
"inputs": [ "inputs": [
+369 -99
View File
@@ -1,6 +1,6 @@
{ {
"contractName": "RewardLocker", "contractName": "RewardLocker",
"contractAddress": "0x6749F75Ece2755d38f209Da1cBab07A1caD69554", "contractAddress": "0x061ff0C800aBc1F3C42f696BeB73C70c6929863a",
"abi": [ "abi": [
{ {
"inputs": [ "inputs": [
@@ -15,7 +15,7 @@
}, },
{ {
"inputs": [], "inputs": [],
"name": "MemeBurnerAlreadyInitialized", "name": "MemeAltarAlreadyInitialized",
"type": "error" "type": "error"
}, },
{ {
@@ -23,6 +23,21 @@
"name": "MemeTokenAlreadyInitialized", "name": "MemeTokenAlreadyInitialized",
"type": "error" "type": "error"
}, },
{
"inputs": [],
"name": "RoundIsNotCompletedYet",
"type": "error"
},
{
"inputs": [],
"name": "TooEarlyToUnstake",
"type": "error"
},
{
"inputs": [],
"name": "Unsynchronized",
"type": "error"
},
{ {
"anonymous": false, "anonymous": false,
"inputs": [ "inputs": [
@@ -33,7 +48,7 @@
"type": "address" "type": "address"
}, },
{ {
"indexed": false, "indexed": true,
"internalType": "uint256", "internalType": "uint256",
"name": "amount", "name": "amount",
"type": "uint256" "type": "uint256"
@@ -42,6 +57,56 @@
"name": "ClaimedReward", "name": "ClaimedReward",
"type": "event" "type": "event"
}, },
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "staker",
"type": "address"
},
{
"indexed": true,
"internalType": "uint256",
"name": "stakedRound",
"type": "uint256"
},
{
"indexed": true,
"internalType": "uint256",
"name": "stakedAmount",
"type": "uint256"
}
],
"name": "RewardStaked",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "unstaker",
"type": "address"
},
{
"indexed": true,
"internalType": "uint256",
"name": "unstakeRound",
"type": "uint256"
},
{
"indexed": true,
"internalType": "uint256",
"name": "unstakedAmount",
"type": "uint256"
}
],
"name": "RewardUnstaked",
"type": "event"
},
{ {
"anonymous": false, "anonymous": false,
"inputs": [ "inputs": [
@@ -51,6 +116,12 @@
"name": "user", "name": "user",
"type": "address" "type": "address"
}, },
{
"indexed": true,
"internalType": "uint256",
"name": "roundNumber",
"type": "uint256"
},
{ {
"indexed": true, "indexed": true,
"internalType": "address", "internalType": "address",
@@ -58,7 +129,7 @@
"type": "address" "type": "address"
}, },
{ {
"indexed": true, "indexed": false,
"internalType": "uint256", "internalType": "uint256",
"name": "reward", "name": "reward",
"type": "uint256" "type": "uint256"
@@ -83,7 +154,7 @@
"type": "address" "type": "address"
}, },
{ {
"indexed": false, "indexed": true,
"internalType": "uint256", "internalType": "uint256",
"name": "totalRoundRewards", "name": "totalRoundRewards",
"type": "uint256" "type": "uint256"
@@ -106,23 +177,29 @@
"type": "event" "type": "event"
}, },
{ {
"anonymous": false,
"inputs": [ "inputs": [
{ {
"indexed": true,
"internalType": "address", "internalType": "address",
"name": "_burnedToken", "name": "unstaker",
"type": "address" "type": "address"
} },
],
"name": "claim",
"outputs": [
{ {
"indexed": true,
"internalType": "uint256", "internalType": "uint256",
"name": "claimedAmount", "name": "unstakeRound",
"type": "uint256"
},
{
"indexed": true,
"internalType": "uint256",
"name": "unstakedAmount",
"type": "uint256" "type": "uint256"
} }
], ],
"stateMutability": "nonpayable", "name": "UnstakeOrdered",
"type": "function" "type": "event"
}, },
{ {
"inputs": [ "inputs": [
@@ -133,7 +210,7 @@
}, },
{ {
"internalType": "address[]", "internalType": "address[]",
"name": "_burnedTokens", "name": "_sacrificedTokens",
"type": "address[]" "type": "address[]"
} }
], ],
@@ -148,81 +225,6 @@
"stateMutability": "nonpayable", "stateMutability": "nonpayable",
"type": "function" "type": "function"
}, },
{
"inputs": [
{
"internalType": "address[]",
"name": "_burnedTokens",
"type": "address[]"
}
],
"name": "claim",
"outputs": [
{
"internalType": "uint256",
"name": "claimedAmount",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_round",
"type": "uint256"
}
],
"name": "claim",
"outputs": [
{
"internalType": "uint256",
"name": "claimedAmount",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_round",
"type": "uint256"
},
{
"internalType": "address[]",
"name": "_burnedTokens",
"type": "address[]"
}
],
"name": "claim",
"outputs": [
{
"internalType": "uint256",
"name": "claimedAmount",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "claim",
"outputs": [
{
"internalType": "uint256",
"name": "claimedAmount",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{ {
"inputs": [ "inputs": [
{ {
@@ -251,7 +253,7 @@
}, },
{ {
"internalType": "address", "internalType": "address",
"name": "_burnedToken", "name": "_sacrificedToken",
"type": "address" "type": "address"
} }
], ],
@@ -270,31 +272,103 @@
"inputs": [ "inputs": [
{ {
"internalType": "uint256", "internalType": "uint256",
"name": "_round", "name": "roundNumber",
"type": "uint256"
}
],
"name": "getSacrificableTokens",
"outputs": [
{
"internalType": "address[]",
"name": "",
"type": "address[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "roundNumber",
"type": "uint256" "type": "uint256"
}, },
{ {
"internalType": "address", "internalType": "address",
"name": "_burnedToken", "name": "sacrificedToken",
"type": "address" "type": "address"
} }
], ],
"name": "claim", "name": "getSacrificedTokenCoefficient",
"outputs": [ "outputs": [
{ {
"internalType": "uint256", "internalType": "uint256",
"name": "claimedAmount", "name": "",
"type": "uint256" "type": "uint256"
} }
], ],
"stateMutability": "nonpayable", "stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "roundNumber",
"type": "uint256"
},
{
"internalType": "address",
"name": "sacrificedToken",
"type": "address"
}
],
"name": "getSacrificedTokenTotalRewards",
"outputs": [
{
"internalType": "uint256",
"name": "totalDefaultRewardsForToken",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "totalRewardsForToken",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function" "type": "function"
}, },
{ {
"inputs": [ "inputs": [
{ {
"internalType": "address", "internalType": "address",
"name": "_memeBurner", "name": "beneficiary",
"type": "address"
},
{
"internalType": "uint256[]",
"name": "roundNumbers",
"type": "uint256[]"
}
],
"name": "getTotalRewardsOf",
"outputs": [
{
"internalType": "uint256",
"name": "totalRewardsAmount",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_memeAltar",
"type": "address" "type": "address"
}, },
{ {
@@ -323,7 +397,7 @@
}, },
{ {
"inputs": [], "inputs": [],
"name": "memeBurner", "name": "memeAltar",
"outputs": [ "outputs": [
{ {
"internalType": "address", "internalType": "address",
@@ -347,6 +421,19 @@
"stateMutability": "view", "stateMutability": "view",
"type": "function" "type": "function"
}, },
{
"inputs": [],
"name": "orderUnstake",
"outputs": [
{
"internalType": "uint256",
"name": "unstakeRound",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{ {
"inputs": [ "inputs": [
{ {
@@ -356,7 +443,7 @@
}, },
{ {
"internalType": "address[]", "internalType": "address[]",
"name": "burnableTokens", "name": "sacrificableTokens",
"type": "address[]" "type": "address[]"
} }
], ],
@@ -380,7 +467,7 @@
}, },
{ {
"internalType": "address", "internalType": "address",
"name": "_burnedToken", "name": "_sacrificedToken",
"type": "address" "type": "address"
}, },
{ {
@@ -468,6 +555,11 @@
"name": "roundCompleted", "name": "roundCompleted",
"type": "bool" "type": "bool"
}, },
{
"internalType": "uint256",
"name": "totalDefaultRewards",
"type": "uint256"
},
{ {
"internalType": "uint256", "internalType": "uint256",
"name": "totalRewards", "name": "totalRewards",
@@ -476,6 +568,184 @@
], ],
"stateMutability": "view", "stateMutability": "view",
"type": "function" "type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "stakeCoefficient",
"type": "uint256"
},
{
"internalType": "uint256[]",
"name": "_rounds",
"type": "uint256[]"
},
{
"internalType": "address[]",
"name": "_sacrificedTokens",
"type": "address[]"
}
],
"name": "stakeAndClaim",
"outputs": [
{
"internalType": "uint256",
"name": "stakedAmount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "claimedAmount",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
},
{
"internalType": "uint8",
"name": "v",
"type": "uint8"
},
{
"internalType": "bytes32",
"name": "r",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "s",
"type": "bytes32"
}
],
"name": "stakeToBeSecured",
"outputs": [
{
"internalType": "uint256",
"name": "stakedAmount",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256[]",
"name": "_rounds",
"type": "uint256[]"
},
{
"internalType": "address[]",
"name": "_sacrificedTokens",
"type": "address[]"
}
],
"name": "stakeToBeSecured",
"outputs": [
{
"internalType": "uint256",
"name": "stakedAmount",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "stakeToBeSecured",
"outputs": [
{
"internalType": "uint256",
"name": "stakedAmount",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "staked",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "unstakeRound",
"type": "uint256"
}
],
"name": "unstake",
"outputs": [
{
"internalType": "uint256",
"name": "unstakedAmount",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
},
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "unstakeOrdered",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
} }
] ]
} }
-4
View File
@@ -127,10 +127,6 @@ async function test(e) {
function addTokens(value) { function addTokens(value) {
tokenNumber.value = tokenNumber.value + value; tokenNumber.value = tokenNumber.value + value;
} }
function getImageUrl(url) {
return new URL(url, import.meta.url).href;
}
</script> </script>
<style lang="sass"> <style lang="sass">
+4
View File
@@ -14,5 +14,9 @@ export const useMemeburnerStore = defineStore("memeburner", {
async getGoal(roundnumber) { async getGoal(roundnumber) {
return await this.contract.methods.rounds(roundnumber).call(); return await this.contract.methods.rounds(roundnumber).call();
}, },
//returns participated, amount achieved
async getSacrificedMeme(roundnumber, address) {
return await this.contract.methods.getSacrificedMeme(roundnumber, address).call();
},
}, },
}); });