Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new payout set function #152

Merged
merged 2 commits into from
Jun 27, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
remove test
  • Loading branch information
M-Rb3 committed Jun 26, 2024
commit 35104215e8b74d37e573f7012d980a1ebe15c702
131 changes: 2 additions & 129 deletions src/pages/Pot/components/Header/Header.tsx
Original file line number Diff line number Diff line change
@@ -23,129 +23,6 @@ import { ButtonsWrapper, Container, Description, Fund, HeaderWrapper, Referral,
const Header = () => {
const { IPFS_BASE_URL, NADA_BOT_URL } = constants;

const payoutsToProcess = {
"nearscript1.near": {
totalAmount: "106400000000000000000000000",
matchingAmount: "1221292742554639409796199769",
donorCount: 80,
},
"indexers.intear.near": {
totalAmount: "61328000000000000000000000",
matchingAmount: "1052429255284545690573653853",
donorCount: 76,
},
"forefront_tak.near": {
totalAmount: "23920000000000000000000000",
matchingAmount: "1017795309846140648156973490",
donorCount: 75,
},
"joydragon.near": {
totalAmount: "205346666666666666660000000",
matchingAmount: "949006792806217598301456686",
donorCount: 87,
},
"aifunding.near": {
totalAmount: "164016666666666666660000000",
matchingAmount: "486706329182254638442302741",
donorCount: 73,
},
"nearfunds.near": {
totalAmount: "255990000000000000000000000",
matchingAmount: "315999046792861248853710509",
donorCount: 41,
},
"bosmobile.near": {
totalAmount: "5866666666666666660000000",
matchingAmount: "95018358419661384687264767",
donorCount: 27,
},
"tenkdao.near": {
totalAmount: "25700000000000000000000000",
matchingAmount: "84768332486089891980101065",
donorCount: 22,
},
"flutterchain.near": {
totalAmount: "4300000000000000000000000",
matchingAmount: "64341480821177500776565514",
donorCount: 24,
},
"socialcap.near": {
totalAmount: "3150000000000000000000000",
matchingAmount: "16426156526838575279632703",
donorCount: 11,
},
"republicdev.near": {
totalAmount: "14750000000000000000000000",
matchingAmount: "16301638804234824423327740",
donorCount: 10,
},
"nearcatalog.near": {
totalAmount: "13370000000000000000000000",
matchingAmount: "12773452455552630118427512",
donorCount: 12,
},
"keypom.near": {
totalAmount: "12450000000000000000000000",
matchingAmount: "8633866656017489135311047",
donorCount: 11,
},
"opencann.near": {
totalAmount: "2550000000000000000000000",
matchingAmount: "8520929051496037041024945",
donorCount: 9,
},
"hyperfiles.near": {
totalAmount: "4500000000000000000000000",
matchingAmount: "7175893550273837340437242",
donorCount: 10,
},
"chatafisha.near": {
totalAmount: "3750000000000000000000000",
matchingAmount: "5721480376946320106575752",
donorCount: 7,
},
"alem-lib.near": {
totalAmount: "2866666666666666660000000",
matchingAmount: "5461862919955969786302666",
donorCount: 7,
},
"i-am-human.sputnik-dao.near": {
totalAmount: "3050000000000000000000000",
matchingAmount: "3154558959139585411883485",
donorCount: 6,
},
"nearbadger.near": {
totalAmount: "2750000000000000000000000",
matchingAmount: "2306877194624002210165043",
donorCount: 7,
},
"agentswithbenefits.near": {
totalAmount: "2350000000000000000000000",
matchingAmount: "1603995357843272573036784",
donorCount: 6,
},
"goodworks.near": {
totalAmount: "2616666666666666660000000",
matchingAmount: "1498083873769490543631205",
donorCount: 5,
},
"bos-workspace.near": {
totalAmount: "4180000000000000000000000",
matchingAmount: "1475224345503222044349658",
donorCount: 6,
},
"opact_near.near": {
totalAmount: "3450000000000000000000000",
matchingAmount: "1147649110306675875620541",
donorCount: 5,
},
"refoundlabs.near": {
totalAmount: "2716666666666666660000000",
matchingAmount: "784752623910056542045283",
donorCount: 5,
},
};

const { potId, transactionHashes } = useParams();

// Start Modals provider
@@ -166,7 +43,7 @@ const Header = () => {
const [flaggedAddresses, setFlaggedAddresses] = useState(null);
const [potDetail, setPotDetail] = useState<null | PotDetail>(null);
const [allDonations, setAlldonations] = useState<null | PotDonation[]>(null);
const [payoutsToProcesss, setPayoutsToProcess] = useState<any>(null);
const [payoutsToProcess, setPayoutsToProcess] = useState<any>(null);
// set fund mathcing pool success
const [fundDonation, setFundDonation] = useState<null | ExtendedFundDonation>(null);

@@ -260,7 +137,7 @@ const Header = () => {

const projectNotRegistered = registryStatus === null;
const userIsAdminOrGreater = admins.includes(accountId) || owner === accountId;
const userIsChefOrGreater = userIsAdminOrGreater || chef === accountId || true;
const userIsChefOrGreater = userIsAdminOrGreater || chef === accountId;

const existingApplication = PotSDK.getApplicationByProjectId(potId, context.accountId);

@@ -289,11 +166,7 @@ const Header = () => {

const handleSetPayouts = () => {
if (allDonations && flaggedAddresses !== null) {
console.log({ matching_pool_balance, allDonations, flaggedAddresses });

calculatePayouts(allDonations, matching_pool_balance, flaggedAddresses).then((calculatedPayouts: any) => {
console.log("test1");

setPayoutsToProcess(calculatedPayouts);
});
} else {
Loading