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

merge from main #32

Merged
merged 49 commits into from
Nov 20, 2024
Merged
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
215ba63
don't continue to load if a specified file is not found
odilitime Nov 20, 2024
8962b65
don't require .env to exist
odilitime Nov 20, 2024
d5cf113
learna an npm
ponderingdemocritus Nov 20, 2024
c3ab946
add note about .env being optional
odilitime Nov 20, 2024
846b1ec
fix build
ponderingdemocritus Nov 20, 2024
42f1529
up
ponderingdemocritus Nov 20, 2024
f41ff92
Update contributing.md to incorporate PR Title / Description / Issue …
monilpat Nov 20, 2024
fa450e7
Update pr.yaml to use actual check
monilpat Nov 20, 2024
4154da2
Merge pull request #426 from odilitime/stable-11-17
ponderingdemocritus Nov 20, 2024
817a410
Merge branch 'main' of https://github.com/ai16z/eliza into release
ponderingdemocritus Nov 20, 2024
03ecab8
Merge pull request #428 from ai16z/release
ponderingdemocritus Nov 20, 2024
0367838
v0.1.1
ponderingdemocritus Nov 20, 2024
ede2cc3
chore: update changelog
actions-user Nov 20, 2024
acde8bf
since agent is moved out of packages, adjust default path
odilitime Nov 20, 2024
347581d
configs
ponderingdemocritus Nov 20, 2024
a7bf8fb
config
ponderingdemocritus Nov 20, 2024
a1d0efc
Merge pull request #431 from ai16z/fix-config
ponderingdemocritus Nov 20, 2024
9908001
v0.1.2
ponderingdemocritus Nov 20, 2024
ea26d00
chore: update changelog
actions-user Nov 20, 2024
714a380
Merge pull request #430 from monilpat/patch-1
sirkitree Nov 20, 2024
18c9fad
linting
ponderingdemocritus Nov 20, 2024
6855a25
Merge pull request #433 from ai16z/imports
ponderingdemocritus Nov 20, 2024
8658bcf
v0.1.3-alpha.0
ponderingdemocritus Nov 20, 2024
7c9bbcc
chore: update changelog
actions-user Nov 20, 2024
7c35361
chore: update changelog
actions-user Nov 20, 2024
aa978a7
chore: update changelog
actions-user Nov 20, 2024
9a0e474
Merge pull request #427 from odilitime/env-change
jkbrooks Nov 20, 2024
02effe0
Merge pull request #429 from monilpat/main
jkbrooks Nov 20, 2024
b9d3b6d
v0.1.3-alpha.1
ponderingdemocritus Nov 20, 2024
cb3141c
chore: update changelog
actions-user Nov 20, 2024
06a3893
imports
ponderingdemocritus Nov 20, 2024
2263f75
Merge pull request #435 from ai16z/fix-imports
ponderingdemocritus Nov 20, 2024
167c586
v0.1.3-alpha.2
ponderingdemocritus Nov 20, 2024
a3e7ba6
chore: update changelog
actions-user Nov 20, 2024
667bdf7
path
ponderingdemocritus Nov 20, 2024
b013276
Merge pull request #436 from ai16z/fix-paths
ponderingdemocritus Nov 20, 2024
7843a37
Merge pull request #432 from odilitime/fix-character-path
ponderingdemocritus Nov 20, 2024
d49611b
Fix linter issues
martincik Nov 18, 2024
8073472
Fix linter issues and add console.log instead
martincik Nov 20, 2024
e867920
Add console.log instead of ignore the error
martincik Nov 20, 2024
9db1f63
Merge pull request #397 from martincik/fix/fix-linter-issues
jkbrooks Nov 20, 2024
bc8f3f8
The bot is by default defeaned and we don't want that
martincik Nov 20, 2024
1ae22ee
Feature Modification: Add all the stlye guidelines to the context
o-on-x Nov 20, 2024
21a4f6a
fixes some console logs
ponderingdemocritus Nov 20, 2024
b0a0b84
Merge pull request #441 from o-on-x/main
lalalune Nov 20, 2024
71371e1
Merge pull request #440 from ai16z/cleanups
lalalune Nov 20, 2024
b31f600
Merge pull request #437 from martincik/fix/undefean-the-bot-and-use-v…
lalalune Nov 20, 2024
b8c74a6
unrug
ponderingdemocritus Nov 20, 2024
5d86a5b
Merge pull request #444 from ai16z/unrug-fix
ponderingdemocritus Nov 20, 2024
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
Next Next commit
unrug
  • Loading branch information
ponderingdemocritus committed Nov 20, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit b8c74a608b1ecf65963b6a3205047fa8ace57745
1 change: 1 addition & 0 deletions packages/plugin-starknet/package.json
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@
"@ai16z/eliza": "workspace:*",
"@ai16z/plugin-trustdb": "workspace:*",
"@avnu/avnu-sdk": "^2.1.1",
"@uniswap/sdk-core": "^6.0.0",
"@unruggable_starknet/core": "^0.1.0",
"starknet": "^6.17.0",
"tsup": "^8.3.5",
78 changes: 64 additions & 14 deletions packages/plugin-starknet/src/actions/unruggable.ts
Original file line number Diff line number Diff line change
@@ -10,19 +10,23 @@ import {
} from "@ai16z/eliza";
import { composeContext } from "@ai16z/eliza";
import { generateObject } from "@ai16z/eliza";

import { Percent } from "@uniswap/sdk-core";
import {
getStarknetAccount,
getStarknetProvider,
parseFormatedAmount,
parseFormatedPercentage,
validateSettings,
} from "../utils/index.ts";
import { DeployData, Factory } from "@unruggable_starknet/core";

interface SwapContent {
sellTokenAddress: string;
buyTokenAddress: string;
sellAmount: string;
}
import {
AMM,
EKUBO_TICK_SPACING,
LiquidityType,
QUOTE_TOKEN_SYMBOL,
RECOMMENDED_EKUBO_FEES,
} from "@unruggable_starknet/core/constants";
import { ACCOUNTS, TOKENS } from "../utils/constants.ts";

export function isDeployTokenContent(
content: DeployData
@@ -108,6 +112,7 @@ export const deployToken: Action = {
context: deployContext,
modelClass: ModelClass.MEDIUM,
});

elizaLogger.log("init supply." + response.initialSupply);
elizaLogger.log(response);

@@ -127,20 +132,65 @@ export const deployToken: Action = {
chainId: await provider.getChainId(),
});

const { tokenAddress, calls } = factory.getDeployCalldata({
name: response.name,
symbol: response.symbol,
owner: response.owner,
initialSupply: response.initialSupply,
});
const { tokenAddress, calls: deployCalls } =
factory.getDeployCalldata({
name: response.name,
symbol: response.symbol,
owner: response.owner,
initialSupply: response.initialSupply,
});

const data = await factory.getMemecoinLaunchData(tokenAddress);

const { calls: launchCalls } = await factory.getEkuboLaunchCalldata(
{
address: tokenAddress,
name: response.name,
symbol: response.symbol,
owner: response.owner,
totalSupply: response.initialSupply,
decimals: 18,
...data,
},
{
fees: parseFormatedPercentage("3"),
amm: AMM.EKUBO,
teamAllocations: [
{
address: ACCOUNTS.ELIZA,
amount: new Percent(
2.5,
response.initialSupply
).toFixed(0),
},
{
address: ACCOUNTS.BLOBERT,
amount: new Percent(
2.5,
response.initialSupply
).toFixed(0),
},
],
holdLimit: parseFormatedPercentage("2"),
antiBotPeriod: 3600,
quoteToken: {
address: TOKENS.LORDS,
symbol: "LORDS" as QUOTE_TOKEN_SYMBOL,
name: "Lords",
decimals: 18,
camelCased: false,
},
startingMarketCap: parseFormatedAmount("5000"),
}
);

elizaLogger.log(
"Deployment has been initiated for coin: " +
response.name +
" at address: " +
tokenAddress
);
const tx = await account.execute(calls);
const tx = await account.execute([...deployCalls, ...launchCalls]);

callback?.({
text:
8 changes: 8 additions & 0 deletions packages/plugin-starknet/src/utils/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export enum TOKENS {
LORDS = "0x0124aeb495b947201f5fac96fd1138e326ad86195b98df6dec9009158a533b49",
}

export enum ACCOUNTS {
ELIZA = "0x07c6eE09d10C9a98E5100F017439b825c85c5cbdaE1146c602013F79f4db9f1D",
BLOBERT = "0x04837488b417a286a4a42ccb296398c86b7a88b3ef74c67425aac34b9467f03f",
}
40 changes: 40 additions & 0 deletions packages/plugin-starknet/src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Content, IAgentRuntime } from "@ai16z/eliza";
import { Fraction, Percent } from "@uniswap/sdk-core";

import { Account, Contract, RpcProvider } from "starknet";

@@ -78,3 +79,42 @@ export function isTransferContent(

return validAddresses;
}

export const getPercent = (amount: string | number, decimals: number) => {
return new Percent(amount, decimals);
};

export const parseFormatedAmount = (amount: string) => amount.replace(/,/g, "");

export const PERCENTAGE_INPUT_PRECISION = 2;

export const parseFormatedPercentage = (percent: string) =>
new Percent(
+percent * 10 ** PERCENTAGE_INPUT_PRECISION,
100 * 10 ** PERCENTAGE_INPUT_PRECISION
);

interface ParseCurrencyAmountOptions {
fixed: number;
significant?: number;
}

export const formatCurrenyAmount = (
amount: Fraction,
{ fixed, significant = 1 }: ParseCurrencyAmountOptions
) => {
const fixedAmount = amount.toFixed(fixed);
const significantAmount = amount.toSignificant(significant);

if (+significantAmount > +fixedAmount) return significantAmount;
else return +fixedAmount.toString();
};

export const formatPercentage = (percentage: Percent) => {
const formatedPercentage = +percentage.toFixed(2);
const exact = percentage.equalTo(
new Percent(Math.round(formatedPercentage * 100), 10000)
);

return `${exact ? "" : "~"}${formatedPercentage}%`;
};
37 changes: 36 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.