Skip to content

[Mainnet] Update bonding curve to 500-step exponential via updateCurve() #56

@realproject7

Description

@realproject7

Summary

The v3 StoryFactory was deployed with a 2-step curve by mistake instead of the intended 500-step exponential curve. This causes storyline tokens to have a staircase price (0.002 → 2.00 at 500K supply) instead of a smooth exponential growth.

Current curve (wrong):

Step Price Supply Range
0 0.002 0 → 500,000
1 2.000 500,000 → 1,000,000

Fix

Call updateCurve(newRanges, newPrices) on the v3 factory (0x337c5b96f03fB335b433291695A4171fd5dED8B0) from the owner wallet with the exact 500-step curve data below.

Important: Do NOT use generateCurve() from DeployBase.s.sol — that produces a different curve shape. Use the exact values from this issue.

Note: Existing storylines (e.g. story #15) keep their 2-step curve permanently — MCV2_Bond bakes the curve into each token at creation time.

Steps

1. Write a Foundry script script/UpdateCurve.s.sol

The script must:

  • Hardcode the exact 500 stepRanges and stepPrices from the table below
  • Convert prices to 18-decimal wei (e.g. 0.0010000 → 1000000000000000)
  • Convert supplies to 18-decimal wei (e.g. 2,000 → 2000000000000000000000)
  • Call factory.updateCurve(stepRanges, stepPrices) from the deployer wallet
  • Log step count, first price, and last price for verification

2. Run the script on mainnet

source .env && forge script script/UpdateCurve.s.sol --rpc-url base --broadcast -vvvv

3. Verify

cast call 0x337c5b96f03fB335b433291695A4171fd5dED8B0 "stepPrices(uint256)" 0 --rpc-url base
cast call 0x337c5b96f03fB335b433291695A4171fd5dED8B0 "stepPrices(uint256)" 1 --rpc-url base
cast call 0x337c5b96f03fB335b433291695A4171fd5dED8B0 "stepPrices(uint256)" 499 --rpc-url base

Step 0 = 0.001, step 1 = 0.0010068, step 499 ≈ 1.8882421.

Exact 500-Step Curve Data (Source of Truth)

Each row: supply_range, price_per_token

2,000    0.0010000
4,000    0.0010068
6,000    0.0010137
8,000    0.0010207
10,000    0.0010277
12,000    0.0010347
14,000    0.0010419
16,000    0.0010491
18,000    0.0010563
20,000    0.0010636
22,000    0.0010710
24,000    0.0010784
26,000    0.0010859
28,000    0.0010935
30,000    0.0011011
32,000    0.0011088
34,000    0.0011166
36,000    0.0011245
38,000    0.0011324
40,000    0.0011403
42,000    0.0011484
44,000    0.0011565
46,000    0.0011647
48,000    0.0011730
50,000    0.0011813
52,000    0.0011897
54,000    0.0011982
56,000    0.0012068
58,000    0.0012154
60,000    0.0012241
62,000    0.0012329
64,000    0.0012418
66,000    0.0012507
68,000    0.0012598
70,000    0.0012689
72,000    0.0012781
74,000    0.0012874
76,000    0.0012967
78,000    0.0013062
80,000    0.0013157
82,000    0.0013254
84,000    0.0013351
86,000    0.0013449
88,000    0.0013548
90,000    0.0013648
92,000    0.0013748
94,000    0.0013850
96,000    0.0013953
98,000    0.0014056
100,000    0.0014161
102,000    0.0014266
104,000    0.0014373
106,000    0.0014480
108,000    0.0014589
110,000    0.0014699
112,000    0.0014809
114,000    0.0014921
116,000    0.0015033
118,000    0.0015147
120,000    0.0015262
122,000    0.0015378
124,000    0.0015495
126,000    0.0015613
128,000    0.0015732
130,000    0.0015853
132,000    0.0015974
134,000    0.0016097
136,000    0.0016221
138,000    0.0016346
140,000    0.0016472
142,000    0.0016600
144,000    0.0016728
146,000    0.0016858
148,000    0.0016990
150,000    0.0017122
152,000    0.0017256
154,000    0.0017391
156,000    0.0017528
158,000    0.0017665
160,000    0.0017805
162,000    0.0017945
164,000    0.0018087
166,000    0.0018230
168,000    0.0018375
170,000    0.0018521
172,000    0.0018669
174,000    0.0018818
176,000    0.0018969
178,000    0.0019121
180,000    0.0019275
182,000    0.0019430
184,000    0.0019586
186,000    0.0019745
188,000    0.0019905
190,000    0.0020066
192,000    0.0020230
194,000    0.0020395
196,000    0.0020561
198,000    0.0020729
200,000    0.0020899
202,000    0.0021071
204,000    0.0021245
206,000    0.0021420
208,000    0.0021597
210,000    0.0021776
212,000    0.0021957
214,000    0.0022140
216,000    0.0022324
218,000    0.0022511
220,000    0.0022699
222,000    0.0022890
224,000    0.0023082
226,000    0.0023277
228,000    0.0023473
230,000    0.0023672
232,000    0.0023872
234,000    0.0024075
236,000    0.0024280
238,000    0.0024487
240,000    0.0024697
242,000    0.0024909
244,000    0.0025122
246,000    0.0025339
248,000    0.0025557
250,000    0.0025778
252,000    0.0026001
254,000    0.0026227
256,000    0.0026455
258,000    0.0026686
260,000    0.0026919
262,000    0.0027155
264,000    0.0027393
266,000    0.0027634
268,000    0.0027878
270,000    0.0028124
272,000    0.0028373
274,000    0.0028625
276,000    0.0028880
278,000    0.0029137
280,000    0.0029397
282,000    0.0029661
284,000    0.0029927
286,000    0.0030196
288,000    0.0030468
290,000    0.0030743
292,000    0.0031022
294,000    0.0031303
296,000    0.0031588
298,000    0.0031876
300,000    0.0032167
302,000    0.0032462
304,000    0.0032760
306,000    0.0033061
308,000    0.0033366
310,000    0.0033675
312,000    0.0033987
314,000    0.0034302
316,000    0.0034622
318,000    0.0034945
320,000    0.0035271
322,000    0.0035602
324,000    0.0035937
326,000    0.0036275
328,000    0.0036617
330,000    0.0036964
332,000    0.0037314
334,000    0.0037669
336,000    0.0038028
338,000    0.0038391
340,000    0.0038759
342,000    0.0039131
344,000    0.0039508
346,000    0.0039889
348,000    0.0040274
350,000    0.0040665
352,000    0.0041060
354,000    0.0041459
356,000    0.0041864
358,000    0.0042274
360,000    0.0042689
362,000    0.0043108
364,000    0.0043533
366,000    0.0043964
368,000    0.0044399
370,000    0.0044840
372,000    0.0045287
374,000    0.0045739
376,000    0.0046196
378,000    0.0046660
380,000    0.0047129
382,000    0.0047604
384,000    0.0048085
386,000    0.0048573
388,000    0.0049066
390,000    0.0049566
392,000    0.0050072
394,000    0.0050585
396,000    0.0051104
398,000    0.0051630
400,000    0.0052162
402,000    0.0052702
404,000    0.0053248
406,000    0.0053802
408,000    0.0054363
410,000    0.0054931
412,000    0.0055506
414,000    0.0056089
416,000    0.0056680
418,000    0.0057279
420,000    0.0057885
422,000    0.0058500
424,000    0.0059123
426,000    0.0059754
428,000    0.0060393
430,000    0.0061042
432,000    0.0061698
434,000    0.0062364
436,000    0.0063039
438,000    0.0063723
440,000    0.0064416
442,000    0.0065118
444,000    0.0065830
446,000    0.0066552
448,000    0.0067284
450,000    0.0068026
452,000    0.0068778
454,000    0.0069541
456,000    0.0070314
458,000    0.0071098
460,000    0.0071893
462,000    0.0072699
464,000    0.0073517
466,000    0.0074346
468,000    0.0075187
470,000    0.0076039
472,000    0.0076904
474,000    0.0077781
476,000    0.0078670
478,000    0.0079573
480,000    0.0080488
482,000    0.0081417
484,000    0.0082359
486,000    0.0083314
488,000    0.0084284
490,000    0.0085267
492,000    0.0086265
494,000    0.0087278
496,000    0.0088306
498,000    0.0089348
500,000    0.0090407
502,000    0.0091481
504,000    0.0092570
506,000    0.0093677
508,000    0.0094799
510,000    0.0095939
512,000    0.0097096
514,000    0.0098270
516,000    0.0099462
518,000    0.0100672
520,000    0.0101901
522,000    0.0103149
524,000    0.0104415
526,000    0.0105701
528,000    0.0107007
530,000    0.0108334
532,000    0.0109680
534,000    0.0111048
536,000    0.0112438
538,000    0.0113849
540,000    0.0115282
542,000    0.0116738
544,000    0.0118217
546,000    0.0119719
548,000    0.0121245
550,000    0.0122796
552,000    0.0124372
554,000    0.0125973
556,000    0.0127599
558,000    0.0129253
560,000    0.0130933
562,000    0.0132640
564,000    0.0134375
566,000    0.0136139
568,000    0.0137932
570,000    0.0139755
572,000    0.0141607
574,000    0.0143491
576,000    0.0145406
578,000    0.0147352
580,000    0.0149332
582,000    0.0151345
584,000    0.0153392
586,000    0.0155474
588,000    0.0157591
590,000    0.0159744
592,000    0.0161934
594,000    0.0164162
596,000    0.0166429
598,000    0.0168734
600,000    0.0171080
602,000    0.0173467
604,000    0.0175895
606,000    0.0178366
608,000    0.0180880
610,000    0.0183439
612,000    0.0186044
614,000    0.0188694
616,000    0.0191393
618,000    0.0194139
620,000    0.0196935
622,000    0.0199782
624,000    0.0202680
626,000    0.0205631
628,000    0.0208635
630,000    0.0211695
632,000    0.0214811
634,000    0.0217985
636,000    0.0221218
638,000    0.0224510
640,000    0.0227864
642,000    0.0231281
644,000    0.0234763
646,000    0.0238310
648,000    0.0241924
650,000    0.0245607
652,000    0.0249361
654,000    0.0253186
656,000    0.0257085
658,000    0.0261060
660,000    0.0265111
662,000    0.0269241
664,000    0.0273453
666,000    0.0277746
668,000    0.0282125
670,000    0.0286590
672,000    0.0291144
674,000    0.0295788
676,000    0.0300526
678,000    0.0305359
680,000    0.0310289
682,000    0.0315319
684,000    0.0320452
686,000    0.0325689
688,000    0.0331034
690,000    0.0336489
692,000    0.0342057
694,000    0.0347740
696,000    0.0353542
698,000    0.0359465
700,000    0.0365513
702,000    0.0371689
704,000    0.0377996
706,000    0.0384437
708,000    0.0391016
710,000    0.0397736
712,000    0.0404601
714,000    0.0411615
716,000    0.0418782
718,000    0.0426105
720,000    0.0433589
722,000    0.0441238
724,000    0.0449057
726,000    0.0457049
728,000    0.0465220
730,000    0.0473575
732,000    0.0482117
734,000    0.0490854
736,000    0.0499789
738,000    0.0508928
740,000    0.0518278
742,000    0.0527843
744,000    0.0537629
746,000    0.0547644
748,000    0.0557892
750,000    0.0568382
752,000    0.0579119
754,000    0.0590111
756,000    0.0601365
758,000    0.0612889
760,000    0.0624690
762,000    0.0636776
764,000    0.0649157
766,000    0.0661839
768,000    0.0674833
770,000    0.0688147
772,000    0.0701791
774,000    0.0715775
776,000    0.0730109
778,000    0.0744804
780,000    0.0759870
782,000    0.0775319
784,000    0.0791163
786,000    0.0807413
788,000    0.0824083
790,000    0.0841185
792,000    0.0858734
794,000    0.0876742
796,000    0.0895225
798,000    0.0914197
800,000    0.0933675
802,000    0.0953674
804,000    0.0974212
806,000    0.0995305
808,000    0.1016973
810,000    0.1039233
812,000    0.1062106
814,000    0.1085611
816,000    0.1109771
818,000    0.1134606
820,000    0.1160139
822,000    0.1186395
824,000    0.1213399
826,000    0.1241174
828,000    0.1269749
830,000    0.1299151
832,000    0.1329410
834,000    0.1360554
836,000    0.1392615
838,000    0.1425627
840,000    0.1459623
842,000    0.1494637
844,000    0.1530709
846,000    0.1567875
848,000    0.1606176
850,000    0.1645653
852,000    0.1686351
854,000    0.1728315
856,000    0.1771593
858,000    0.1816233
860,000    0.1862289
862,000    0.1909813
864,000    0.1958863
866,000    0.2009499
868,000    0.2061781
870,000    0.2115774
872,000    0.2171546
874,000    0.2229169
876,000    0.2288715
878,000    0.2350263
880,000    0.2413894
882,000    0.2479693
884,000    0.2547749
886,000    0.2618156
888,000    0.2691012
890,000    0.2766420
892,000    0.2844488
894,000    0.2925330
896,000    0.3009064
898,000    0.3095815
900,000    0.3185715
902,000    0.3278903
904,000    0.3375523
906,000    0.3475728
908,000    0.3579679
910,000    0.3687546
912,000    0.3799506
914,000    0.3915748
916,000    0.4036470
918,000    0.4161880
920,000    0.4292198
922,000    0.4427658
924,000    0.4568503
926,000    0.4714994
928,000    0.4867404
930,000    0.5026022
932,000    0.5191154
934,000    0.5363124
936,000    0.5542275
938,000    0.5728968
940,000    0.5923590
942,000    0.6126547
944,000    0.6338271
946,000    0.6559221
948,000    0.6789882
950,000    0.7030773
952,000    0.7282443
954,000    0.7545474
956,000    0.7820489
958,000    0.8108148
960,000    0.8409156
962,000    0.8724262
964,000    0.9054268
966,000    0.9400025
968,000    0.9762446
970,000    1.0142503
972,000    1.0541236
974,000    1.0959757
976,000    1.1399256
978,000    1.1861009
980,000    1.2346381
982,000    1.2856836
984,000    1.3393947
986,000    1.3959402
988,000    1.4555013
990,000    1.5182733
992,000    1.5844660
994,000    1.6543057
996,000    1.7280361
998,000    1.8059202
1,000,000    1.8882421

Acceptance Criteria

  • script/UpdateCurve.s.sol created with the exact 500 data points above
  • Prices converted to 18-decimal wei (e.g. 0.0010000 → 1000000000000000)
  • Supplies converted to 18-decimal wei (e.g. 2,000 → 2000000000000000000000)
  • Script calls updateCurve() on v3 factory from owner wallet
  • Run on mainnet — transaction succeeds
  • Verify: step 0 price = 0.001, step 1 price = 0.0010068, step 499 price ≈ 1.8882421
  • Create a test storyline after update to confirm new tokens use the 500-step curve

Branch

task/56-update-curve-500step

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/T3Assigned to T3 builder agentbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions